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 type
C - the breakable collection type
E - 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 Details

    • permitsNulls

      protected boolean permitsNulls
    • permitsDuplicates

      protected boolean permitsDuplicates
    • permitsIncompatibleTypes

      protected boolean permitsIncompatibleTypes
    • unsupportedMethods

      protected final Collection<OptionalMethod> unsupportedMethods
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder()
      Default constructor to be called by default constructors for subclasses.
    • AbstractBuilder

      protected AbstractBuilder(@NotNull @NotNull Collection<E> elements)
    • AbstractBuilder

      protected AbstractBuilder(BreakableCollection.AbstractBuilder<B,C,E> other)
      Parameters:
      other - the builder to copy.
      Throws:
      NullPointerException - if the argument is null.
  • Method Details

    • doesNotPermitNulls

      public B doesNotPermitNulls()
      Sets the builder to construct a collection that does not permit nulls. By default, the collection will support null.
      Returns:
      th builder.
    • doesNotPermitDuplicates

      public B 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

      public B 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

      public final B doesNotSupportMethod(OptionalMethod method)
      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.