Package pl.poznan.put.structure.formats
Class ImmutableExtendedEntry.Builder
java.lang.Object
pl.poznan.put.structure.formats.ImmutableExtendedEntry.Builder
- Enclosing class:
- ImmutableExtendedEntry
Builds instances of type
ImmutableExtendedEntry
.
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 TypeMethodDescriptionafter
(int after) Initializes the value for theafter
attribute.before
(int before) Initializes the value for thebefore
attribute.build()
Builds a newImmutableExtendedEntry
.Initializes the value for thecomment
attribute.from
(Ct.ExtendedEntry instance) Fill a builder with attribute values from the providedExtendedEntry
instance.index
(int index) Initializes the value for theindex
attribute.original
(int original) Initializes the value for theoriginal
attribute.pair
(int pair) Initializes the value for thepair
attribute.seq
(char seq) Initializes the value for theseq
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedExtendedEntry
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
-
index
Initializes the value for theindex
attribute.- Parameters:
index
- The value for index- Returns:
this
builder for use in a chained invocation
-
seq
Initializes the value for theseq
attribute.- Parameters:
seq
- The value for seq- Returns:
this
builder for use in a chained invocation
-
before
Initializes the value for thebefore
attribute.- Parameters:
before
- The value for before- Returns:
this
builder for use in a chained invocation
-
after
Initializes the value for theafter
attribute.- Parameters:
after
- The value for after- Returns:
this
builder for use in a chained invocation
-
pair
Initializes the value for thepair
attribute.- Parameters:
pair
- The value for pair- Returns:
this
builder for use in a chained invocation
-
original
Initializes the value for theoriginal
attribute.- Parameters:
original
- The value for original- Returns:
this
builder for use in a chained invocation
-
comment
Initializes the value for thecomment
attribute.If not set, this attribute will have a default value as returned by the initializer of
comment
.- Parameters:
comment
- The value for comment- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableExtendedEntry
.- Returns:
- An immutable instance of ExtendedEntry
- Throws:
IllegalStateException
- if any required attributes are missing
-