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>
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 Summary
Modifier and TypeFieldDescriptionprivate ColumnExtractorFunction
<T, U> private String
private static final long
private static final long
private long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableColumnExtractor
.final ColumnExtractor.Builder
<T, U> columnExtractorFunction
(ColumnExtractorFunction<T, U> columnExtractorFunction) Initializes the value for thecolumnExtractorFunction
attribute.private String
final ColumnExtractor.Builder
<T, U> from
(ColumnExtractor<T, U> instance) Fill a builder with attribute values from the providedColumnExtractor
instance.final ColumnExtractor.Builder
<T, U> Initializes the value for theheader
attribute.
-
Field Details
-
INIT_BIT_HEADER
private static final long INIT_BIT_HEADER- See Also:
-
INIT_BIT_COLUMN_EXTRACTOR_FUNCTION
private static final long INIT_BIT_COLUMN_EXTRACTOR_FUNCTION- See Also:
-
initBits
private long initBits -
header
-
columnExtractorFunction
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableColumnExtractor
instances.new ColumnExtractor.Builder<T, U>() .header(String) // required
header
.columnExtractorFunction(net.bmahe.genetics4j.extras.evolutionlisteners.ColumnExtractorFunction<T, U>) // requiredcolumnExtractorFunction
.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedColumnExtractor
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
Initializes the value for theheader
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 thecolumnExtractorFunction
attribute.- Parameters:
columnExtractorFunction
- The value for columnExtractorFunction- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableColumnExtractor
.- Returns:
- An immutable instance of ColumnExtractor
- Throws:
IllegalStateException
- if any required attributes are missing
-
formatRequiredAttributesMessage
-