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.Builderbuilder()Creates a builder forImmutableBasePair.static ImmutableBasePairCreates an immutable copy of aBasePairvalue.booleanThis instance is equal to all instances ofImmutableBasePairthat have equal attribute values.inthashCode()Computes a hash code from attributes:left,right.left()static ImmutableBasePairof(PdbNamedResidueIdentifier left, PdbNamedResidueIdentifier right) Construct a new immutableBasePairinstance.right()final ImmutableBasePairCopy the current immutable object by setting a value for theleftattribute.final ImmutableBasePairCopy the current immutable object by setting a value for therightattribute.
-
Method Details
-
left
-
right
-
withLeft
Copy the current immutable object by setting a value for theleftattribute. 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
thisobject
-
withRight
Copy the current immutable object by setting a value for therightattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableBasePairthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:left,right. -
of
Construct a new immutableBasePairinstance.- Parameters:
left- The value for theleftattributeright- The value for therightattribute- Returns:
- An immutable BasePair instance
-
copyOf
Creates an immutable copy of aBasePairvalue. 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) // requiredleft.right(pl.poznan.put.pdb.PdbNamedResidueIdentifier) // requiredright.build();- Returns:
- A new ImmutableBasePair builder
-