Package org.infinispan.schematic.document

Examples of org.infinispan.schematic.document.EditableDocument.merge()


        Document doc1 = Json.read(stream("json/merge-1.json"));
        Document doc2 = Json.read(stream("json/merge-2.json"));
        Document doc3 = Json.read(stream("json/merge-3.json"));
        EditableDocument editor = new DocumentEditor((MutableDocument)doc1);
        assertThat(Json.writePretty(editor).equals(Json.writePretty(doc3)), is(false));
        editor.merge(doc2);
        assertThat(Json.writePretty(editor).equals(Json.writePretty(doc3)), is(true));
    }
}
View Full Code Here


            if (!Null.matches(otherDoc)) {
                // Get the corresponding value in this document ...
                EditableDocument thisField = getDocument(field.getName());
                if (!Null.matches(thisField)) {
                    // There are docs in both sides, so merge them ...
                    thisField.merge(otherDoc);
                } else {
                    // There is not a document on this side (perhaps another value), so replace with that other doc ...
                    doSetValue(field.getName(), otherDoc);
                }
            } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.