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