Package com.rosetta.model.lib.process
Interface BuilderMerger
public interface BuilderMerger
Defines a processor that merges two RosettaModelObjectBuilder instances into o1 single instance.
Implementations of this interface are designed to be used with the RosettaModelObjectBuilder merge method to
perform visitor pattern processing on the object, updating the underlying object as it traverses the tree.
Typically used to merge or un-merge an object with a "template".
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> voidmergeBasic(List<? extends T> o1, List<? extends T> o2, Consumer<T> o1Add) Merge the two lists of primitive types.<T> voidmergeBasic(T o1, T o2, Consumer<T> o1Setter, AttributeMeta... metas) Merge the two primitive types.<T extends RosettaModelObjectBuilder>
voidmergeRosetta(List<? extends T> o1, List<? extends T> o2, Function<Integer, T> o1GetOrCreateByIndex) Merge the two RosettaModelObjectBuilder object lists.<T extends RosettaModelObjectBuilder>
voidmergeRosetta(T o1, T o2, Consumer<T> o1Setter) Merge the two RosettaModelObjectBuilder objects.<T extends RosettaModelObjectBuilder>
voidrun(T o1, T o2) Start merging the two RosettaModelObjectBuilder objects.
-
Method Details
-
run
Start merging the two RosettaModelObjectBuilder objects.- Parameters:
o1- - a RosettaModelObjectBuilder object, which o2 will be merged into.o2- - a RosettaModelObjectBuilder object, which will be merged into o1, and then discarded. Typically o2 will be a "template" that will be merged into o1.
-
mergeRosetta
Merge the two RosettaModelObjectBuilder objects.- Parameters:
o1- - a RosettaModelObjectBuilder object, which o2 will be merged into.o2- - a RosettaModelObjectBuilder object, which will be merged into o1, and then discarded.o1Setter- - method to overwrite object o1, e.g. lambda to the set method on the o1's parent object.
-
mergeRosetta
<T extends RosettaModelObjectBuilder> void mergeRosetta(List<? extends T> o1, List<? extends T> o2, Function<Integer, T> o1GetOrCreateByIndex) Merge the two RosettaModelObjectBuilder object lists.- Parameters:
o1- - a list of RosettaModelObjectBuilder objects, which o2 will be merged into.o2- - a list of RosettaModelObjectBuilder objects, which will be merged into o1, and then discarded.o1GetOrCreateByIndex- - method to get object at list index, or if absent create object at list index.
-
mergeBasic
Merge the two primitive types.- Parameters:
o1- - a primitive types, which o2 will be merged into.o2- - a primitive types, which will be merged into o1, and then discarded.o1Setter- - method to overwrite object o1, e.g. lambda to the set method on the o1's parent object.metas- - flags indicating meta information about the attribute, e.g. GLOBAL_KEY, EXTERNAL_KEY etc.
-
mergeBasic
Merge the two lists of primitive types.- Parameters:
o1- - a primitive types, which o2 will be merged into.o2- - a primitive types, which will be merged into o1, and then discarded.o1Add- - method to append an item to list o1, e.g. lambda to the add method on the o1's parent object.
-