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

java.lang.Object
net.bmahe.genetics4j.extras.evolutionlisteners.ImmutableColumnExtractor<T,U>
All Implemented Interfaces:
ColumnExtractor<T,U>

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableColumnExtractor<T extends Comparable<T>,U> extends Object implements ColumnExtractor<T,U>
Immutable implementation of ColumnExtractor.

Use the builder to create immutable instances: new ColumnExtractor.Builder(). Use the static factory method to create immutable instances: ImmutableColumnExtractor.of().

  • Field Details

  • Constructor Details

  • Method Details

    • header

      public String header()
      Specified by:
      header in interface ColumnExtractor<T extends Comparable<T>,U>
      Returns:
      The value of the header attribute
    • columnExtractorFunction

      public ColumnExtractorFunction<T,U> columnExtractorFunction()
      Specified by:
      columnExtractorFunction in interface ColumnExtractor<T extends Comparable<T>,U>
      Returns:
      The value of the columnExtractorFunction attribute
    • withHeader

      public final ImmutableColumnExtractor<T,U> withHeader(String value)
      Copy the current immutable object by setting a value for the header attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for header
      Returns:
      A modified copy of the this object
    • withColumnExtractorFunction

      public final ImmutableColumnExtractor<T,U> withColumnExtractorFunction(ColumnExtractorFunction<T,U> value)
      Copy the current immutable object by setting a value for the columnExtractorFunction attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for columnExtractorFunction
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableColumnExtractor that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableColumnExtractor<?,?> another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: header, columnExtractorFunction.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ColumnExtractor with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static <T extends Comparable<T>, U> ImmutableColumnExtractor<T,U> of(String header, ColumnExtractorFunction<T,U> columnExtractorFunction)
      Construct a new immutable ColumnExtractor instance.
      Type Parameters:
      T - generic parameter T
      U - generic parameter U
      Parameters:
      header - The value for the header attribute
      columnExtractorFunction - The value for the columnExtractorFunction attribute
      Returns:
      An immutable ColumnExtractor instance
    • copyOf

      public static <T extends Comparable<T>, U> ImmutableColumnExtractor<T,U> copyOf(ColumnExtractor<T,U> instance)
      Creates an immutable copy of a ColumnExtractor value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      T - generic parameter T
      U - generic parameter U
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ColumnExtractor instance