Class ImmutableColumnExtractor.Builder<T extends Comparable<T>,U>

java.lang.Object
net.bmahe.genetics4j.extras.evolutionlisteners.ImmutableColumnExtractor.Builder<T,U>
Direct Known Subclasses:
ColumnExtractor.Builder
Enclosing class:
ImmutableColumnExtractor<T extends Comparable<T>,U>

public static class ImmutableColumnExtractor.Builder<T extends Comparable<T>,U> extends Object
Builds instances of type ImmutableColumnExtractor. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Field Details

  • Constructor Details

    • Builder

      public Builder()
      Creates a builder for ImmutableColumnExtractor instances.
       new ColumnExtractor.Builder&lt;T, U&gt;()
          .header(String) // required header
          .columnExtractorFunction(net.bmahe.genetics4j.extras.evolutionlisteners.ColumnExtractorFunction&lt;T, U&gt;) // required columnExtractorFunction
          .build();
       
  • Method Details

    • from

      public final ColumnExtractor.Builder<T,U> from(ColumnExtractor<T,U> instance)
      Fill a builder with attribute values from the provided ColumnExtractor instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • header

      public final ColumnExtractor.Builder<T,U> header(String header)
      Initializes the value for the header attribute.
      Parameters:
      header - The value for header
      Returns:
      this builder for use in a chained invocation
    • columnExtractorFunction

      public final ColumnExtractor.Builder<T,U> columnExtractorFunction(ColumnExtractorFunction<T,U> columnExtractorFunction)
      Initializes the value for the columnExtractorFunction attribute.
      Parameters:
      columnExtractorFunction - The value for columnExtractorFunction
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableColumnExtractor<T,U> build()
      Returns:
      An immutable instance of ColumnExtractor
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()