public static class Key2List.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 |
---|---|
Key2List<E,K1,K2> |
build() |
Key2List.Builder<E,K1,K2> |
withAfterDeleteTrigger(java.util.function.Consumer<E> trigger)
Specify delete trigger.
|
Key2List.Builder<E,K1,K2> |
withAfterInsertTrigger(java.util.function.Consumer<E> trigger)
Specify insert trigger.
|
Key2List.Builder<E,K1,K2> |
withBeforeDeleteTrigger(java.util.function.Consumer<E> trigger)
Specify delete trigger.
|
Key2List.Builder<E,K1,K2> |
withBeforeInsertTrigger(java.util.function.Consumer<E> trigger)
Specify insert trigger.
|
Key2List.Builder<E,K1,K2> |
withCapacity(int capacity)
Specify initial capacity.
|
Key2List.Builder<E,K1,K2> |
withConstraint(java.util.function.Predicate<E> constraint)
Specify element constraint.
|
Key2List.Builder<E,K1,K2> |
withContent(java.util.Collection<? extends E> elements)
Specify elements added to the collection upon creation.
|
Key2List.Builder<E,K1,K2> |
withContent(E... elements)
Specify elements added to the collection upon creation.
|
Key2List.Builder<E,K1,K2> |
withElemDuplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withElemDuplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withElemNull(boolean allowNull)
Specifies whether null elements are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withElemSet()
Add element map (with ident mapper).
|
Key2List.Builder<E,K1,K2> |
withElemSort(boolean sort)
Specify that the element set should be sorted using the natural comparator.
|
Key2List.Builder<E,K1,K2> |
withElemSort(java.util.Comparator<? super E> comparator)
Set comparator to use for sorting the element set.
|
Key2List.Builder<E,K1,K2> |
withElemSort(java.util.Comparator<? super E> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the element set.
|
Key2List.Builder<E,K1,K2> |
withKey1Duplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey1Duplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey1Map(java.util.function.Function<? super E,K1> mapper)
Add key map.
|
Key2List.Builder<E,K1,K2> |
withKey1Null(boolean allowNull)
Specify whether null elements are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey1Sort(boolean sort)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withKey1Sort(java.util.Comparator<? super K1> comparator)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withKey1Sort(java.util.Comparator<? super K1> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withKey2Duplicates(boolean allowDuplicates)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey2Duplicates(boolean allowDuplicates,
boolean allowDuplicatesNull)
Specify whether duplicates are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey2Map(java.util.function.Function<? super E,K2> mapper)
Add key map.
|
Key2List.Builder<E,K1,K2> |
withKey2Null(boolean allowNull)
Specify whether null elements are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withKey2Sort(boolean sort)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withKey2Sort(java.util.Comparator<? super K2> comparator)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withKey2Sort(java.util.Comparator<? super K2> comparator,
boolean sortNullsFirst)
Set comparator to use for sorting the key map.
|
Key2List.Builder<E,K1,K2> |
withListBig(boolean bigList)
Specify whether list should be stored in an instance of BigList or GapList.
|
Key2List.Builder<E,K1,K2> |
withMaxSize(int maxSize)
Specify maximum size of collection.
|
Key2List.Builder<E,K1,K2> |
withNull(boolean allowNull)
Specifies whether null elements are allowed or not.
|
Key2List.Builder<E,K1,K2> |
withOrderByElem(boolean orderBy)
Specifies that the collection will have the order of the element set.
|
Key2List.Builder<E,K1,K2> |
withOrderByKey1(boolean orderBy)
Specifies that the collection will have the order of the key map.
|
Key2List.Builder<E,K1,K2> |
withOrderByKey1(java.lang.Class<?> type)
Specifies that the list will have the order of the key map.
|
Key2List.Builder<E,K1,K2> |
withOrderByKey2(boolean orderBy)
Specifies that the collection will have the order of the key map.
|
Key2List.Builder<E,K1,K2> |
withOrderByKey2(java.lang.Class<?> type)
Specifies that the list will have the order of the key map.
|
Key2List.Builder<E,K1,K2> |
withPrimaryElem()
Specify the element to be a primary key.
|
Key2List.Builder<E,K1,K2> |
withPrimaryKey1Map(java.util.function.Function<? super E,K1> mapper)
Specify this key to be a primary key.
|
Key2List.Builder<E,K1,K2> |
withPrimaryKey2Map(java.util.function.Function<? super E,K2> mapper)
Specify this key to be a primary key.
|
Key2List.Builder<E,K1,K2> |
withUniqueElem()
Specify the element to be a unique key.
|
Key2List.Builder<E,K1,K2> |
withUniqueKey1Map(java.util.function.Function<? super E,K1> mapper)
Specify this key to be a unique key.
|
Key2List.Builder<E,K1,K2> |
withUniqueKey2Map(java.util.function.Function<? super E,K2> mapper)
Specify this key to be a unique key.
|
Key2List.Builder<E,K1,K2> |
withWindowSize(int maxSize)
Specify maximum window size of collection.
|
withElemCount, withKeyDuplicates, withKeyMap, withKeyNull, withKeySort, withKeySort, withKeySort, withListType, withOrderByElem, withOrderByKey, withOrderByKey, withPrimaryKeyMap, withSetBehavior, withUniqueKeyMap
public Key2List.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 Key2List.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 Key2List.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 Key2List.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 Key2List.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 Key2List.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 Key2List.Builder<E,K1,K2> withCapacity(int capacity)
KeyCollectionImpl.BuilderImpl
withCapacity
in class KeyCollectionImpl.BuilderImpl<E>
capacity
- initial capacitypublic Key2List.Builder<E,K1,K2> withContent(java.util.Collection<? extends E> elements)
KeyCollectionImpl.BuilderImpl
withContent
in class KeyCollectionImpl.BuilderImpl<E>
elements
- initial elementspublic Key2List.Builder<E,K1,K2> withContent(E... elements)
KeyCollectionImpl.BuilderImpl
withContent
in class KeyCollectionImpl.BuilderImpl<E>
elements
- initial elementspublic Key2List.Builder<E,K1,K2> withMaxSize(int maxSize)
KeyCollectionImpl.BuilderImpl
withMaxSize
in class KeyCollectionImpl.BuilderImpl<E>
maxSize
- maximum sizepublic Key2List.Builder<E,K1,K2> withWindowSize(int maxSize)
KeyCollectionImpl.BuilderImpl
withWindowSize
in class KeyCollectionImpl.BuilderImpl<E>
maxSize
- maximum window sizepublic Key2List.Builder<E,K1,K2> withListBig(boolean bigList)
KeyCollectionImpl.BuilderImpl
withListBig
in class KeyCollectionImpl.BuilderImpl<E>
bigList
- true to store list content in an instance of BigList, false for GapListpublic Key2List.Builder<E,K1,K2> withElemSet()
KeyCollectionImpl.BuilderImpl
withElemSet
in class KeyCollectionImpl.BuilderImpl<E>
public Key2List.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 Key2List.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 Key2List.Builder<E,K1,K2> withElemDuplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withElemDuplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicates (default is true)public Key2List.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 Key2List.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 Key2List.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 Key2List.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 Key2List.Builder<E,K1,K2> withPrimaryElem()
KeyCollectionImpl.BuilderImpl
withElemNull(false) and withElemDuplicates(false)
.withPrimaryElem
in class KeyCollectionImpl.BuilderImpl<E>
public Key2List.Builder<E,K1,K2> withUniqueElem()
KeyCollectionImpl.BuilderImpl
withElemNull(true) and withElemDuplicates(false, true)
.withUniqueElem
in class KeyCollectionImpl.BuilderImpl<E>
public Key2List.Builder<E,K1,K2> withKey1Map(java.util.function.Function<? super E,K1> mapper)
mapper
- mapper to usepublic Key2List.Builder<E,K1,K2> withPrimaryKey1Map(java.util.function.Function<? super E,K1> mapper)
mapper
- mapper to usepublic Key2List.Builder<E,K1,K2> withUniqueKey1Map(java.util.function.Function<? super E,K1> mapper)
mapper
- mapper to usepublic Key2List.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 Key2List.Builder<E,K1,K2> withOrderByKey1(java.lang.Class<?> type)
KeyCollectionImpl.BuilderImpl
int
.
The key map will be sorted using the natural comparator and no null values are allowed.withOrderByKey1
in class KeyCollectionImpl.BuilderImpl<E>
type
- primitive type to use for key map
(only one key map or the element set can have the order by option set)public Key2List.Builder<E,K1,K2> withKey1Null(boolean allowNull)
KeyCollectionImpl.BuilderImpl
withKey1Null
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements, false to disallowpublic Key2List.Builder<E,K1,K2> withKey1Duplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withKey1Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatespublic Key2List.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 Key2List.Builder<E,K1,K2> withKey1Sort(boolean sort)
KeyCollectionImpl.BuilderImpl
withKey1Sort
in class KeyCollectionImpl.BuilderImpl<E>
sort
- true to sort key mappublic Key2List.Builder<E,K1,K2> withKey1Sort(java.util.Comparator<? super K1> comparator)
comparator
- comparator to use for sortingpublic Key2List.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 Key2List.Builder<E,K1,K2> withKey2Map(java.util.function.Function<? super E,K2> mapper)
mapper
- mapper to usepublic Key2List.Builder<E,K1,K2> withPrimaryKey2Map(java.util.function.Function<? super E,K2> mapper)
withKey2Map(mapper), withKey2Null(false), and withKey2Duplicates(false)
.mapper
- mapper to usepublic Key2List.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 Key2List.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 Key2List.Builder<E,K1,K2> withOrderByKey2(java.lang.Class<?> type)
KeyCollectionImpl.BuilderImpl
int
.
The key map will be sorted using the natural comparator and no null values are allowed.withOrderByKey2
in class KeyCollectionImpl.BuilderImpl<E>
type
- primitive type to use for key map
(only one key map or the element set can have the order by option set)public Key2List.Builder<E,K1,K2> withKey2Null(boolean allowNull)
KeyCollectionImpl.BuilderImpl
withKey2Null
in class KeyCollectionImpl.BuilderImpl<E>
allowNull
- true to allow null elements, false to disallowpublic Key2List.Builder<E,K1,K2> withKey2Duplicates(boolean allowDuplicates)
KeyCollectionImpl.BuilderImpl
withKey2Duplicates
in class KeyCollectionImpl.BuilderImpl<E>
allowDuplicates
- true to allow duplicatespublic Key2List.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 Key2List.Builder<E,K1,K2> withKey2Sort(boolean sort)
KeyCollectionImpl.BuilderImpl
withKey2Sort
in class KeyCollectionImpl.BuilderImpl<E>
sort
- true to sort key mappublic Key2List.Builder<E,K1,K2> withKey2Sort(java.util.Comparator<? super K2> comparator)
comparator
- comparator to use for sortingpublic Key2List.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