Class ImmutableAtomPair
- java.lang.Object
-
- pl.poznan.put.torsion.AtomPair
-
- pl.poznan.put.torsion.ImmutableAtomPair
-
- All Implemented Interfaces:
Comparable<AtomPair>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableAtomPair extends AtomPair
Immutable implementation ofAtomPair.Use the builder to create immutable instances:
ImmutableAtomPair.builder(). Use the static factory method to create immutable instances:ImmutableAtomPair.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAtomPair.BuilderBuilds instances of typeImmutableAtomPair.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BondLengthbondLength()static ImmutableAtomPair.Builderbuilder()Creates a builder forImmutableAtomPair.static ImmutableAtomPaircopyOf(AtomPair instance)Creates an immutable copy of aAtomPairvalue.protected doubledistance()booleanequals(Object another)This instance is equal to all instances ofImmutableAtomPairthat have equal attribute values.inthashCode()Computes a hash code from attributes:leftAtom,rightAtom.static ImmutableAtomPairof(PdbAtomLine leftAtom, PdbAtomLine rightAtom)Construct a new immutableAtomPairinstance.StringtoString()Prints the immutable valueAtomPairwith attribute values.ImmutableAtomPairwithLeftAtom(PdbAtomLine value)Copy the current immutable object by setting a value for theleftAtomattribute.ImmutableAtomPairwithRightAtom(PdbAtomLine value)Copy the current immutable object by setting a value for therightAtomattribute.-
Methods inherited from class pl.poznan.put.torsion.AtomPair
compareTo, generateValidationMessage
-
-
-
-
Method Detail
-
withLeftAtom
public final ImmutableAtomPair withLeftAtom(PdbAtomLine value)
Copy the current immutable object by setting a value for theleftAtomattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for leftAtom- Returns:
- A modified copy of the
thisobject
-
withRightAtom
public final ImmutableAtomPair withRightAtom(PdbAtomLine value)
Copy the current immutable object by setting a value for therightAtomattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rightAtom- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableAtomPairthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:leftAtom,rightAtom.
-
toString
public String toString()
Prints the immutable valueAtomPairwith attribute values.
-
distance
protected double distance()
Returns a lazily initialized value of the
distanceattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.
-
bondLength
protected BondLength bondLength()
Returns a lazily initialized value of the
bondLengthattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Overrides:
bondLengthin classAtomPair- Returns:
- A lazily initialized value of the
bondLengthattribute
-
of
public static ImmutableAtomPair of(PdbAtomLine leftAtom, PdbAtomLine rightAtom)
Construct a new immutableAtomPairinstance.- Parameters:
leftAtom- The value for theleftAtomattributerightAtom- The value for therightAtomattribute- Returns:
- An immutable AtomPair instance
-
copyOf
public static ImmutableAtomPair copyOf(AtomPair instance)
Creates an immutable copy of aAtomPairvalue. 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 AtomPair instance
-
builder
public static ImmutableAtomPair.Builder builder()
Creates a builder forImmutableAtomPair.ImmutableAtomPair.builder() .leftAtom(pl.poznan.put.pdb.PdbAtomLine) // requiredleftAtom.rightAtom(pl.poznan.put.pdb.PdbAtomLine) // requiredrightAtom.build();- Returns:
- A new ImmutableAtomPair builder
-
-