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()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ImmutableColumnExtractor.Builder<T extends Comparable<T>,
U> Builds instances of typeImmutableColumnExtractor
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableColumnExtractor
(String header, ColumnExtractorFunction<T, U> columnExtractorFunction) private
ImmutableColumnExtractor
(ImmutableColumnExtractor<T, U> original, String header, ColumnExtractorFunction<T, U> columnExtractorFunction) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>,
U>
ImmutableColumnExtractor<T, U> copyOf
(ColumnExtractor<T, U> instance) Creates an immutable copy of aColumnExtractor
value.boolean
This instance is equal to all instances ofImmutableColumnExtractor
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableColumnExtractor<?, ?> another) int
hashCode()
Computes a hash code from attributes:header
,columnExtractorFunction
.header()
static <T extends Comparable<T>,
U>
ImmutableColumnExtractor<T, U> of
(String header, ColumnExtractorFunction<T, U> columnExtractorFunction) Construct a new immutableColumnExtractor
instance.toString()
Prints the immutable valueColumnExtractor
with attribute values.final ImmutableColumnExtractor
<T, U> Copy the current immutable object by setting a value for thecolumnExtractorFunction
attribute.final ImmutableColumnExtractor
<T, U> withHeader
(String value) Copy the current immutable object by setting a value for theheader
attribute.
-
Field Details
-
header
-
columnExtractorFunction
-
-
Constructor Details
-
ImmutableColumnExtractor
private ImmutableColumnExtractor(String header, ColumnExtractorFunction<T, U> columnExtractorFunction) -
ImmutableColumnExtractor
private ImmutableColumnExtractor(ImmutableColumnExtractor<T, U> original, String header, ColumnExtractorFunction<T, U> columnExtractorFunction)
-
-
Method Details
-
header
- Specified by:
header
in interfaceColumnExtractor<T extends Comparable<T>,
U> - Returns:
- The value of the
header
attribute
-
columnExtractorFunction
- Specified by:
columnExtractorFunction
in interfaceColumnExtractor<T extends Comparable<T>,
U> - Returns:
- The value of the
columnExtractorFunction
attribute
-
withHeader
Copy the current immutable object by setting a value for theheader
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 thecolumnExtractorFunction
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for columnExtractorFunction- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableColumnExtractor
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:header
,columnExtractorFunction
. -
toString
Prints the immutable valueColumnExtractor
with attribute values. -
of
public static <T extends Comparable<T>,U> ImmutableColumnExtractor<T,U> of(String header, ColumnExtractorFunction<T, U> columnExtractorFunction) Construct a new immutableColumnExtractor
instance.- Type Parameters:
T
- generic parameter TU
- generic parameter U- Parameters:
header
- The value for theheader
attributecolumnExtractorFunction
- The value for thecolumnExtractorFunction
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 aColumnExtractor
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 TU
- generic parameter U- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable ColumnExtractor instance
-