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