Package pl.poznan.put.external.dssr
Class ImmutablePair.Builder
java.lang.Object
pl.poznan.put.external.dssr.ImmutablePair.Builder
- Enclosing class:
- ImmutablePair
Builds instances of type
ImmutablePair
.
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 newImmutablePair
.final ImmutablePair.Builder
Fill a builder with attribute values from the providedPair
instance.final ImmutablePair.Builder
Initializes the value for thelw
attribute.final ImmutablePair.Builder
Initializes the value for thent1
attribute.final ImmutablePair.Builder
Initializes the value for thent2
attribute.final ImmutablePair.Builder
Initializes the value for thesaenger
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPair
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
-
nt1
Initializes the value for thent1
attribute.- Parameters:
nt1
- The value for nt1- Returns:
this
builder for use in a chained invocation
-
nt2
Initializes the value for thent2
attribute.- Parameters:
nt2
- The value for nt2- Returns:
this
builder for use in a chained invocation
-
saenger
Initializes the value for thesaenger
attribute.- Parameters:
saenger
- The value for saenger- Returns:
this
builder for use in a chained invocation
-
lw
Initializes the value for thelw
attribute.- Parameters:
lw
- The value for lw- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutablePair
.- Returns:
- An immutable instance of Pair
- Throws:
IllegalStateException
- if any required attributes are missing
-