public static class CollectionMerger.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
CollectionMerger |
build() |
CollectionMerger.Builder |
deep(boolean val)
Sets effectively infinite
depth(int) (the default) |
CollectionMerger.Builder |
depth(int val)
Depth 1 means a shallow copy - i.e.
|
CollectionMerger.Builder |
mergeNestedLists(java.util.function.BiFunction<java.util.Collection<?>,java.util.Collection<?>,java.util.Collection<?>> listMergeFunction)
Defines a function to use to determine the result when lists or sets need merging.
|
CollectionMerger.Builder |
mergeNestedLists(boolean val)
By default lists will not be merged, and either the first or second will be kept
depending on
preferSecondOnConflict(boolean) . |
CollectionMerger.Builder |
mergeNestedMaps(boolean val)
Deprecated.
since 1.0, never did anything
|
CollectionMerger.Builder |
preferSecondOnConflict(boolean val)
defaults to false, so if there is an unmergeable conflict, e.g.
|
public CollectionMerger.Builder deep(boolean val)
depth(int)
(the default)public CollectionMerger.Builder depth(int val)
mergeNestedLists(boolean)
for
it to do this to nested iterables.@Deprecated public CollectionMerger.Builder mergeNestedMaps(boolean val)
public CollectionMerger.Builder mergeNestedLists(boolean val)
preferSecondOnConflict(boolean)
. Set this to true to cause
lists in the second merge argument to be appended to lists in the first, or false for the default behaviour.
For more complex behaviours use mergeNestedLists(BiFunction)
.public CollectionMerger.Builder mergeNestedLists(java.util.function.BiFunction<java.util.Collection<?>,java.util.Collection<?>,java.util.Collection<?>> listMergeFunction)
public CollectionMerger.Builder preferSecondOnConflict(boolean val)
public CollectionMerger build()