Interface FeatureDefinitionBuilder

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      FeatureDefinitionBuilder add​(java.lang.CharSequence identifier)
      Adds the specified Identifier to this builder if it is not already present.
      <T extends java.lang.CharSequence>
      FeatureDefinitionBuilder
      addAll​(java.lang.Iterable<T> identifiers)
      Adds all of the Identifiers in the specified Iterable to this builder if they're not already present.
      FeatureDefinition build()
      Returns an immutable instance of FeatureDefinition containing the Identifiers which were provided to this builder so far.
      DefinitionIdentifier getFirstIdentifier()
      Returns the first Identifier of this builder or null if an intermediate state of this builder does not contain any Identifiers - however this should be an utterly exception.
      int getSize()
      Returns the count of Identifiers of this builder.
      FeatureDefinitionBuilder remove​(java.lang.CharSequence identifier)
      Removes the specified Identifier from this builder if it is present.
      <T extends java.lang.CharSequence>
      FeatureDefinitionBuilder
      removeAll​(java.lang.Iterable<T> identifiers)
      Removes from this builder all of its Identifiers that are contained in the specified Iterable.
      java.util.stream.Stream<DefinitionIdentifier> stream()
      Returns a sequential Stream with the Identifiers of this builder as its source.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • add

        FeatureDefinitionBuilder add​(java.lang.CharSequence identifier)
        Adds the specified Identifier to this builder if it is not already present.
        Parameters:
        identifier - the Identifier to be added.
        Returns:
        this builder instance to allow method chaining.
        Throws:
        java.lang.NullPointerException - if identifier is null.
        DefinitionIdentifierInvalidException - if identifier is invalid.
      • addAll

        <T extends java.lang.CharSequence> FeatureDefinitionBuilder addAll​(java.lang.Iterable<T> identifiers)
        Adds all of the Identifiers in the specified Iterable to this builder if they're not already present.
        Parameters:
        identifiers - the Identifiers to be added.
        Returns:
        this builder instance to allow method chaining.
        Throws:
        java.lang.NullPointerException - if identifiers is null.
        DefinitionIdentifierInvalidException - if any Identifier of identifiers is invalid.
      • remove

        FeatureDefinitionBuilder remove​(java.lang.CharSequence identifier)
        Removes the specified Identifier from this builder if it is present.
        Parameters:
        identifier - the Identifier to be removed.
        Returns:
        this builder instance to allow method chaining.
        Throws:
        java.lang.NullPointerException - if identifier is null.
        DefinitionIdentifierInvalidException - if identifier is invalid.
      • removeAll

        <T extends java.lang.CharSequence> FeatureDefinitionBuilder removeAll​(java.lang.Iterable<T> identifiers)
        Removes from this builder all of its Identifiers that are contained in the specified Iterable.
        Parameters:
        identifiers - the Identifiers to be removed.
        Returns:
        this builder instance to allow method chaining.
        Throws:
        java.lang.NullPointerException - if identifiers is null.
        DefinitionIdentifierInvalidException - if any Identifier of identifiers is invalid.
      • getFirstIdentifier

        @Nullable
        DefinitionIdentifier getFirstIdentifier()
        Returns the first Identifier of this builder or null if an intermediate state of this builder does not contain any Identifiers - however this should be an utterly exception.
        Returns:
        the Identifier or null.
      • getSize

        int getSize()
        Returns the count of Identifiers of this builder. The size is guaranteed to be at least one.
        Returns:
        the size.
      • stream

        java.util.stream.Stream<DefinitionIdentifier> stream()
        Returns a sequential Stream with the Identifiers of this builder as its source.
        Returns:
        a sequential stream of the Identifiers of this builder.
      • build

        FeatureDefinition build()
        Returns an immutable instance of FeatureDefinition containing the Identifiers which were provided to this builder so far.
        Returns:
        the instance.
        Throws:
        java.lang.IndexOutOfBoundsException - if this builder did not contain any Identifiers.