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.BuilderFill a builder with attribute values from the providedPairinstance.final ImmutablePair.BuilderInitializes the value for thelwattribute.final ImmutablePair.BuilderInitializes the value for thent1attribute.final ImmutablePair.BuilderInitializes the value for thent2attribute.final ImmutablePair.BuilderInitializes the value for thesaengerattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPairinstance. 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
-
nt1
Initializes the value for thent1attribute.- Parameters:
nt1- The value for nt1- Returns:
thisbuilder for use in a chained invocation
-
nt2
Initializes the value for thent2attribute.- Parameters:
nt2- The value for nt2- Returns:
thisbuilder for use in a chained invocation
-
saenger
Initializes the value for thesaengerattribute.- Parameters:
saenger- The value for saenger- Returns:
thisbuilder for use in a chained invocation
-
lw
Initializes the value for thelwattribute.- Parameters:
lw- The value for lw- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutablePair.- Returns:
- An immutable instance of Pair
- Throws:
IllegalStateException- if any required attributes are missing
-