Package org.infinispan.schematic.document

Examples of org.infinispan.schematic.document.Path


        // Now apply the changes to this document and prepare to coallesce the changes for the nested documents ...
        int nextLevel = level + 1;
        Map<String, LinkedList<Conversion>> nextLevelConversionsBySegment = new HashMap<String, LinkedList<Conversion>>();
        for (Conversion conversion : conversions) {
            Path path = conversion.getPath();
            assert path.size() > level;
            String segment = path.get(level);
            if (path.size() == nextLevel) {
                // This is the last segment for this path, so change the output document's field ...
                changedFields.put(segment, conversion.getConvertedValue());
            } else {
                // Otherwise, the path is for the nested document ...
                LinkedList<Conversion> nestedConversions = nextLevelConversionsBySegment.get(segment);
View Full Code Here


            output.writeObject(put.value);
        }

        @Override
        public RemoveValueOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path path = (Path)input.readObject();
            Object value = input.readObject();
            return new RemoveValueOperation(path, value);
        }
View Full Code Here

            output.writeUTF(remove.fieldName);
        }

        @Override
        public RemoveOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path parentPath = (Path)input.readObject();
            String fieldName = input.readUTF();
            return new RemoveOperation(parentPath, fieldName, null);
        }
View Full Code Here

            output.writeObject(put.newValue);
        }

        @Override
        public PutIfAbsentOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path path = (Path)input.readObject();
            String fieldName = input.readUTF();
            Object newValue = input.readObject();
            return new PutIfAbsentOperation(path, fieldName, newValue);
        }
View Full Code Here

        @Override
        public boolean equals( Object obj ) {
            if (obj == this) return true;
            if (obj instanceof Path) {
                Path that = (Path)obj;
                return that.size() == 0;
            }
            return false;
        }
View Full Code Here

            if (obj instanceof SinglePath) {
                SinglePath that = (SinglePath)obj;
                return this.fieldName.equals(that.fieldName);
            }
            if (obj instanceof Path) {
                Path that = (Path)obj;
                if (this.size() != that.size()) return false;
                return this.fieldName.equals(that.get(0));
            }
            return false;
        }
View Full Code Here

            output.writeObject(put.values);
        }

        @Override
        public RemoveAllValuesOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path path = (Path)input.readObject();
            Collection<?> values = (Collection<?>)input.readObject();
            return new RemoveAllValuesOperation(path, values);
        }
View Full Code Here

        @Override
        public boolean equals( Object obj ) {
            if (obj == this) return true;
            if (obj instanceof Path) {
                Path that = (Path)obj;
                if (this.size() != that.size()) return false;
                Iterator<String> thatIter = that.iterator();
                Iterator<String> thisIter = this.iterator();
                while (thatIter.hasNext()) {
                    if (!thisIter.next().equals(thatIter.next())) return false;
                }
                assert !thisIter.hasNext();
View Full Code Here

        return parentPath;
    }

    protected MutableDocument mutableParent( MutableDocument delegate ) {
        MutableDocument parent = delegate;
        Path parentPath = getParentPath();
        for (String fieldName : parentPath) {
            assert parent != null : "Unexpected to find path " + parentPath + " in " + delegate + ". Unable to apply operation "
                                    + this;
            parent = (MutableDocument)parent.getDocument(fieldName);
        }
View Full Code Here

            output.writeObject(put.value);
        }

        @Override
        public AddValueOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path path = (Path)input.readObject();
            int index = input.readInt();
            Object value = input.readObject();
            return new AddValueOperation(path, value, index);
        }
View Full Code Here

TOP

Related Classes of org.infinispan.schematic.document.Path

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.