Package pl.poznan.put.structure
Class ImmutableBasePair
java.lang.Object
pl.poznan.put.structure.BasePair
pl.poznan.put.structure.ImmutableBasePair
- All Implemented Interfaces:
Serializable
,Comparable<BasePair>
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableBasePair
extends BasePair
Immutable implementation of
BasePair
.
Use the builder to create immutable instances:
ImmutableBasePair.builder()
.
Use the static factory method to create immutable instances:
ImmutableBasePair.of()
.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableBasePair.Builder
builder()
Creates a builder forImmutableBasePair
.static ImmutableBasePair
Creates an immutable copy of aBasePair
value.boolean
This instance is equal to all instances ofImmutableBasePair
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:left
,right
.left()
static ImmutableBasePair
of
(PdbNamedResidueIdentifier left, PdbNamedResidueIdentifier right) Construct a new immutableBasePair
instance.right()
final ImmutableBasePair
Copy the current immutable object by setting a value for theleft
attribute.final ImmutableBasePair
Copy the current immutable object by setting a value for theright
attribute.
-
Method Details
-
left
-
right
-
withLeft
Copy the current immutable object by setting a value for theleft
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for left- Returns:
- A modified copy of the
this
object
-
withRight
Copy the current immutable object by setting a value for theright
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for right- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableBasePair
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:left
,right
. -
of
Construct a new immutableBasePair
instance.- Parameters:
left
- The value for theleft
attributeright
- The value for theright
attribute- Returns:
- An immutable BasePair instance
-
copyOf
Creates an immutable copy of aBasePair
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable BasePair instance
-
builder
Creates a builder forImmutableBasePair
.ImmutableBasePair.builder() .left(pl.poznan.put.pdb.PdbNamedResidueIdentifier) // required
left
.right(pl.poznan.put.pdb.PdbNamedResidueIdentifier) // requiredright
.build();- Returns:
- A new ImmutableBasePair builder
-