Package pl.poznan.put.structure.formats
Class ImmutableEntry.Builder
- java.lang.Object
-
- pl.poznan.put.structure.formats.ImmutableEntry.Builder
-
- Enclosing class:
- ImmutableEntry
@NotThreadSafe public static final class ImmutableEntry.Builder extends Object
Builds instances of typeImmutableEntry. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableEntrybuild()Builds a newImmutableEntry.ImmutableEntry.Buildercomment(String comment)Initializes the value for thecommentattribute.ImmutableEntry.Builderfrom(BpSeq.Entry instance)Fill a builder with attribute values from the providedEntryinstance.ImmutableEntry.Builderindex(int index)Initializes the value for theindexattribute.ImmutableEntry.Builderpair(int pair)Initializes the value for thepairattribute.ImmutableEntry.Builderseq(char seq)Initializes the value for theseqattribute.
-
-
-
Method Detail
-
from
public final ImmutableEntry.Builder from(BpSeq.Entry instance)
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
public final ImmutableEntry.Builder index(int index)
Initializes the value for theindexattribute.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
seq
public final ImmutableEntry.Builder seq(char seq)
Initializes the value for theseqattribute.- Parameters:
seq- The value for seq- Returns:
thisbuilder for use in a chained invocation
-
pair
public final ImmutableEntry.Builder pair(int pair)
Initializes the value for thepairattribute.- Parameters:
pair- The value for pair- Returns:
thisbuilder for use in a chained invocation
-
comment
public final ImmutableEntry.Builder comment(String 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
public ImmutableEntry build()
Builds a newImmutableEntry.- Returns:
- An immutable instance of Entry
- Throws:
IllegalStateException- if any required attributes are missing
-
-