Class BreakableCollection.AbstractBuilder<B extends BreakableCollection.AbstractBuilder<B,C,E>,C extends BreakableCollection<E>,E>
java.lang.Object
org.soliscode.test.breakable.BreakableIterable.AbstractBuilder<B,C,E>
org.soliscode.test.breakable.BreakableCollection.AbstractBuilder<B,C,E>
- Type Parameters:
B
- the builder typeC
- the breakable collection typeE
- the element type
- Direct Known Subclasses:
BreakableCollection.Builder
,BreakableSequencedCollection.Builder
- Enclosing class:
BreakableCollection<E>
public abstract static class BreakableCollection.AbstractBuilder<B extends BreakableCollection.AbstractBuilder<B,C,E>,C extends BreakableCollection<E>,E>
extends BreakableIterable.AbstractBuilder<B,C,E>
Utility class for implementing builders for subclasses of BreakableCollection.
- Since:
- 1.0
- Author:
- evanbergstrom
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected final Collection
<OptionalMethod> Fields inherited from class org.soliscode.test.breakable.BreakableIterable.AbstractBuilder
breaks, characteristics, elements
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default constructor to be called by default constructors for subclasses.protected
AbstractBuilder
(@NotNull Collection<E> elements) protected
-
Method Summary
Modifier and TypeMethodDescriptionSets the builder to construct a collection that does not permit duplicate elements.Sets the builder to construct a collection that does not permit incompatible types.Sets the builder to construct a collection that does not permit nulls.final B
doesNotSupportMethod
(OptionalMethod method) Sets the builder to construct a collection that does not support the method provided as the argument.Methods inherited from class org.soliscode.test.breakable.BreakableIterable.AbstractBuilder
addBreak, addElements, addElements, build, copy, doesNotSupport, self, setCharacteristics
-
Field Details
-
permitsNulls
protected boolean permitsNulls -
permitsDuplicates
protected boolean permitsDuplicates -
permitsIncompatibleTypes
protected boolean permitsIncompatibleTypes -
unsupportedMethods
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder()Default constructor to be called by default constructors for subclasses. -
AbstractBuilder
-
AbstractBuilder
- Parameters:
other
- the builder to copy.- Throws:
NullPointerException
- if the argument isnull
.
-
-
Method Details
-
doesNotPermitNulls
Sets the builder to construct a collection that does not permit nulls. By default, the collection will supportnull
.- Returns:
- th builder.
-
doesNotPermitDuplicates
Sets the builder to construct a collection that does not permit duplicate elements. By default, the collection will support duplicate elements.- Returns:
- th builder.
-
doesNotPermitIncompatibleTypes
Sets the builder to construct a collection that does not permit incompatible types. By default, the collection will support incompatible types.- Returns:
- th builder.
-
doesNotSupportMethod
Sets the builder to construct a collection that does not support the method provided as the argument.- Parameters:
method
- the method that the collection does not support.- Returns:
- the builder.
-