Package pl.poznan.put.structure.formats
Class ImmutableEntry.Builder
java.lang.Object
pl.poznan.put.structure.formats.ImmutableEntry.Builder
- Enclosing class:
- ImmutableEntry
Builds instances of type
ImmutableEntry.
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.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableEntry.final ImmutableEntry.BuilderInitializes the value for thecommentattribute.final ImmutableEntry.Builderfrom(BpSeq.Entry instance) Fill a builder with attribute values from the providedEntryinstance.final ImmutableEntry.Builderindex(int index) Initializes the value for theindexattribute.final ImmutableEntry.Builderpair(int pair) Initializes the value for thepairattribute.final ImmutableEntry.Builderseq(char seq) Initializes the value for theseqattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedEntryinstance. 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:
thisbuilder for use in a chained invocation
-
index
Initializes the value for theindexattribute.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
seq
Initializes the value for theseqattribute.- Parameters:
seq- The value for seq- Returns:
thisbuilder for use in a chained invocation
-
pair
Initializes the value for thepairattribute.- Parameters:
pair- The value for pair- Returns:
thisbuilder for use in a chained invocation
-
comment
Initializes the value for thecommentattribute.If not set, this attribute will have a default value as returned by the initializer of
comment.- Parameters:
comment- The value for comment- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableEntry.- Returns:
- An immutable instance of Entry
- Throws:
IllegalStateException- if any required attributes are missing
-