public static class Key2Collection.Builder<E,K1,K2> extends KeyCollectionImpl.BuilderImpl<E>
KeyCollectionImpl.BuilderImpl.KeyMapBuilder<E,K>
Constructor and Description |
---|
Builder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Key2Collection<E,K1,K2> |
build() |
Key2Collection.Builder<E,K1,K2> |
withAfterDeleteTrigger(java.util.function.Consumer<E> trigger)
Specify delete trigger.
|
Key2Collection.Builder<E,K1,K2> |
withAfterInsertTrigger(java.util.function.Consumer<E> trigger)
Specify insert trigger.
|
Key2Collection.Builder<E,K1,K2> |
withBeforeDeleteTrigger(java.util.function.Consumer<E> trigger)
Specify delete trigger.
|
Key2Collection.Builder<E,K1,K2> |
withBeforeInsertTrigger(java.util.function.Consumer<E> trigger)
Specify insert trigger.
|
Key2Collection.Builder<E,K1,K2> |
withCapacity(int capacity)
Specify initial capacity.
|
Key2Collection.Builder<E,K1,K2> |
withConstraint(java.util.function.Predicate<E> constraint)
Specify element constraint.
|
Key2Collection.Builder<E,K1,K2> |
withContent(java.util.Collection<? extends E> elements)
Specify elements added to the collection upon creation.
|
Key2Collection.Builder<E,K1,K2> |
withContent(E... elements)
Specify elements added to the collection upon creation.
|
Key2Collection.Builder<E,K1,K2> |
withElemDuplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withElemDuplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withElemNull(boolean allowNull)
Specifies whether null elements are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withElemSet()
Add element map (with ident mapper).
|
Key2Collection.Builder<E,K1,K2> |
withElemSort(boolean sort)
Specify that the element set should be sorted using the natural comparator.
|
Key2Collection.Builder<E,K1,K2> |
withElemSort(java.util.Comparator<? super E> comparator)
Set comparator to use for sorting the element set.
|
Key2Collection.Builder<E,K1,K2> |
withElemSort(java.util.Comparator<? super E> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the element set.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Duplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Duplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Map(java.util.function.Function<? super E,K1> mapper)
Add key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Null(boolean allowNull)
Specify whether null elements are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Sort(boolean sort)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Sort(java.util.Comparator<? super K1> comparator)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey1Sort(java.util.Comparator<? super K1> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Duplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Duplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Map(java.util.function.Function<? super E,K2> mapper)
Add key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Null(boolean allowNull)
Specify whether null elements are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Sort(boolean sort)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Sort(java.util.Comparator<? super K2> comparator)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withKey2Sort(java.util.Comparator<? super K2> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the key map.
|
Key2Collection.Builder<E,K1,K2> |
withMaxSize(int maxSize)
Specify maximum size of collection.
|
Key2Collection.Builder<E,K1,K2> |
withNull(boolean allowNull)
Specifies whether null elements are allowed or not.
|
Key2Collection.Builder<E,K1,K2> |
withOrderByElem(boolean orderBy)
Specifies that the collection will have the order of the element set.
|
Key2Collection.Builder<E,K1,K2> |
withOrderByKey1(boolean orderBy)
Specifies that the collection will have the order of the key map.
|
Key2Collection.Builder<E,K1,K2> |
withOrderByKey2(boolean orderBy)
Specifies that the collection will have the order of the key map.
|
Key2Collection.Builder<E,K1,K2> |
withPrimaryElem()
Specify the element to be a primary key.
|
Key2Collection.Builder<E,K1,K2> |
withPrimaryKey1Map(java.util.function.Function<? super E,K1> mapper)
Specify this key to be a primary key.
|
Key2Collection.Builder<E,K1,K2> |
withPrimaryKey2Map(java.util.function.Function<? super E,K2> mapper)
Specify this key to be a primary key.
|
Key2Collection.Builder<E,K1,K2> |
withSetBehavior(boolean setBehavior)
Specifies that the collection behaves like a
Set on adding elements, i.e. |
Key2Collection.Builder<E,K1,K2> |
withUniqueElem()
Specify the element to be a unique key.
|
Key2Collection.Builder<E,K1,K2> |
withUniqueKey1Map(java.util.function.Function<? super E,K1> mapper)
Specify this key to be a unique key.
|
Key2Collection.Builder<E,K1,K2> |
withUniqueKey2Map(java.util.function.Function<? super E,K2> mapper)
Specify this key to be a unique key.
|
withElemCount, withKeyDuplicates, withKeyMap, withKeyNull, withKeySort, withKeySort, withKeySort, withListBig, withListType, withOrderByElem, withOrderByKey, withOrderByKey, withOrderByKey1, withOrderByKey2, withPrimaryKeyMap, withUniqueKeyMap, withWindowSize
public Key2Collection<E,K1,K2> build()
public Key2Collection.Builder<E,K1,K2> withNull(boolean allowNull)
KeyCollectionImpl.BuilderImpl
KeyCollectionImpl.BuilderImpl.withElemNull(boolean)
does.withNull
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements (default), false to disallowpublic Key2Collection.Builder<E,K1,K2> withConstraint(java.util.function.Predicate<E> constraint)
KeyCollectionImpl.BuilderImpl
withConstraint
in class KeyCollectionImpl.BuilderImpl<E>
constraint
- constraint element must satisfy, null for none (default)public Key2Collection.Builder<E,K1,K2> withBeforeInsertTrigger(java.util.function.Consumer<E> trigger)
KeyCollectionImpl.BuilderImpl
withBeforeInsertTrigger
in class KeyCollectionImpl.BuilderImpl<E>
trigger
- insert trigger method, null for none (default)public Key2Collection.Builder<E,K1,K2> withAfterInsertTrigger(java.util.function.Consumer<E> trigger)
KeyCollectionImpl.BuilderImpl
withAfterInsertTrigger
in class KeyCollectionImpl.BuilderImpl<E>
trigger
- insert trigger method, null for none (default)public Key2Collection.Builder<E,K1,K2> withBeforeDeleteTrigger(java.util.function.Consumer<E> trigger)
KeyCollectionImpl.BuilderImpl
withBeforeDeleteTrigger
in class KeyCollectionImpl.BuilderImpl<E>
trigger
- delete trigger method, null for none (default)public Key2Collection.Builder<E,K1,K2> withAfterDeleteTrigger(java.util.function.Consumer<E> trigger)
KeyCollectionImpl.BuilderImpl
withAfterDeleteTrigger
in class KeyCollectionImpl.BuilderImpl<E>
trigger
- delete trigger method, null for none (default)public Key2Collection.Builder<E,K1,K2> withCapacity(int capacity)
KeyCollectionImpl.BuilderImpl
withCapacity
in class KeyCollectionImpl.BuilderImpl<E>
capacity
- initial capacitypublic Key2Collection.Builder<E,K1,K2> withContent(java.util.Collection<? extends E> elements)
KeyCollectionImpl.BuilderImpl
withContent
in class KeyCollectionImpl.BuilderImpl<E>
elements
- initial elementspublic Key2Collection.Builder<E,K1,K2> withContent(E... elements)
KeyCollectionImpl.BuilderImpl
withContent
in class KeyCollectionImpl.BuilderImpl<E>
elements
- initial elementspublic Key2Collection.Builder<E,K1,K2> withMaxSize(int maxSize)
KeyCollectionImpl.BuilderImpl
withMaxSize
in class KeyCollectionImpl.BuilderImpl<E>
maxSize
- maximum sizepublic Key2Collection.Builder<E,K1,K2> withSetBehavior(boolean setBehavior)
KeyCollectionImpl.BuilderImpl
Set
on adding elements, i.e.
if an element cannot be added due to duplicate or other constraints, no exception is thrown.withSetBehavior
in class KeyCollectionImpl.BuilderImpl<E>
setBehavior
- true to define set behavior (default is false)public Key2Collection.Builder<E,K1,K2> withElemSet()
KeyCollectionImpl.BuilderImpl
withElemSet
in class KeyCollectionImpl.BuilderImpl<E>
public Key2Collection.Builder<E,K1,K2> withOrderByElem(boolean orderBy)
KeyCollectionImpl.BuilderImpl
withOrderByElem
in class KeyCollectionImpl.BuilderImpl<E>
orderBy
- if true the collection will have the order of the element set
(default is false, only one key map or the element set can have the order by option set)public Key2Collection.Builder<E,K1,K2> withElemNull(boolean allowNull)
KeyCollectionImpl.BuilderImpl
KeyCollectionImpl.BuilderImpl.withNull(boolean)
does not.withElemNull
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements, false to disallow (default is true)public Key2Collection.Builder<E,K1,K2> withElemDuplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withElemDuplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicates (default is true)public Key2Collection.Builder<E,K1,K2> withElemDuplicates(boolean allowDuplicates, boolean allowDuplicatesNull)
KeyCollectionImpl.BuilderImpl
withElemDuplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicates (default is true)allowDuplicatesNull
- true to allow duplicate null values (default is true)public Key2Collection.Builder<E,K1,K2> withElemSort(boolean sort)
KeyCollectionImpl.BuilderImpl
withElemSort
in class KeyCollectionImpl.BuilderImpl<E>
sort
- true to sorted, false for unsorted (default is false)public Key2Collection.Builder<E,K1,K2> withElemSort(java.util.Comparator<? super E> comparator)
KeyCollectionImpl.BuilderImpl
withElemSort
in class KeyCollectionImpl.BuilderImpl<E>
comparator
- comparator to use for sorting (null for natural comparator)public Key2Collection.Builder<E,K1,K2> withElemSort(java.util.Comparator<? super E> comparator, boolean sortNullsFirst)
KeyCollectionImpl.BuilderImpl
withElemSort
in class KeyCollectionImpl.BuilderImpl<E>
comparator
- comparator to use for sortingsortNullsFirst
- true to sort null values first, false for lastpublic Key2Collection.Builder<E,K1,K2> withPrimaryElem()
KeyCollectionImpl.BuilderImpl
withElemNull(false) and withElemDuplicates(false)
.withPrimaryElem
in class KeyCollectionImpl.BuilderImpl<E>
public Key2Collection.Builder<E,K1,K2> withUniqueElem()
KeyCollectionImpl.BuilderImpl
withElemNull(true) and withElemDuplicates(false, true)
.withUniqueElem
in class KeyCollectionImpl.BuilderImpl<E>
public Key2Collection.Builder<E,K1,K2> withKey1Map(java.util.function.Function<? super E,K1> mapper)
mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withPrimaryKey1Map(java.util.function.Function<? super E,K1> mapper)
withKey1Map(mapper), withKey1Null(false), and withKey1Duplicates(false)
.mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withUniqueKey1Map(java.util.function.Function<? super E,K1> mapper)
withKey1Map(mapper), withKey1Null(true), and withKey1Duplicates(false, true)
.mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withOrderByKey1(boolean orderBy)
KeyCollectionImpl.BuilderImpl
withOrderByKey1
in class KeyCollectionImpl.BuilderImpl<E>
orderBy
- if true the collection will have the order of the key map
(default is false, only one key map or the element set can have the order by option set)public Key2Collection.Builder<E,K1,K2> withKey1Null(boolean allowNull)
KeyCollectionImpl.BuilderImpl
withKey1Null
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements, false to disallowpublic Key2Collection.Builder<E,K1,K2> withKey1Duplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withKey1Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatespublic Key2Collection.Builder<E,K1,K2> withKey1Duplicates(boolean allowDuplicates, boolean allowDuplicatesNull)
KeyCollectionImpl.BuilderImpl
withKey1Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatesallowDuplicatesNull
- true to allow duplicate null valuespublic Key2Collection.Builder<E,K1,K2> withKey1Sort(boolean sort)
KeyCollectionImpl.BuilderImpl
withKey1Sort
in class KeyCollectionImpl.BuilderImpl<E>
sort
- true to sort key mappublic Key2Collection.Builder<E,K1,K2> withKey1Sort(java.util.Comparator<? super K1> comparator)
comparator
- comparator to use for sortingpublic Key2Collection.Builder<E,K1,K2> withKey1Sort(java.util.Comparator<? super K1> comparator, boolean sortNullsFirst)
comparator
- comparator to use for sortingsortNullsFirst
- true if null will be sorted first, false for lastpublic Key2Collection.Builder<E,K1,K2> withKey2Map(java.util.function.Function<? super E,K2> mapper)
mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withPrimaryKey2Map(java.util.function.Function<? super E,K2> mapper)
withKey2Map(mapper), withKey2Null(false), and withKey2Duplicates(false)
.mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withUniqueKey2Map(java.util.function.Function<? super E,K2> mapper)
withKey2Map(mapper), withKey2Null(true), and withKey2Duplicates(false, true)
.mapper
- mapper to usepublic Key2Collection.Builder<E,K1,K2> withOrderByKey2(boolean orderBy)
KeyCollectionImpl.BuilderImpl
withOrderByKey2
in class KeyCollectionImpl.BuilderImpl<E>
orderBy
- if true the collection will have the order of the key map
(default is false, only one key map or the element set can have the order by option set)public Key2Collection.Builder<E,K1,K2> withKey2Null(boolean allowNull)
KeyCollectionImpl.BuilderImpl
withKey2Null
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements, false to disallowpublic Key2Collection.Builder<E,K1,K2> withKey2Duplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withKey2Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatespublic Key2Collection.Builder<E,K1,K2> withKey2Duplicates(boolean allowDuplicates, boolean allowDuplicatesNull)
KeyCollectionImpl.BuilderImpl
withKey2Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatesallowDuplicatesNull
- true to allow duplicate null valuespublic Key2Collection.Builder<E,K1,K2> withKey2Sort(boolean sort)
KeyCollectionImpl.BuilderImpl
withKey2Sort
in class KeyCollectionImpl.BuilderImpl<E>
sort
- true to sort key mappublic Key2Collection.Builder<E,K1,K2> withKey2Sort(java.util.Comparator<? super K2> comparator)
comparator
- comparator to use for sortingpublic Key2Collection.Builder<E,K1,K2> withKey2Sort(java.util.Comparator<? super K2> comparator, boolean sortNullsFirst)
comparator
- comparator to use for sortingsortNullsFirst
- true if null will be sorted first, false for last