Class ImmutableTorsionAngleDelta

java.lang.Object
pl.poznan.put.torsion.TorsionAngleDelta
pl.poznan.put.torsion.ImmutableTorsionAngleDelta
All Implemented Interfaces:
DisplayableExportable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableTorsionAngleDelta extends TorsionAngleDelta
Immutable implementation of TorsionAngleDelta.

Use the builder to create immutable instances: ImmutableTorsionAngleDelta.builder(). Use the static factory method to create immutable instances: ImmutableTorsionAngleDelta.of().

  • Method Details

    • angleType

      public MasterTorsionAngleType angleType()
      Specified by:
      angleType in class TorsionAngleDelta
      Returns:
      The type of torsion angle.
    • state

      public TorsionAngleDelta.State state()
      Specified by:
      state in class TorsionAngleDelta
      Returns:
      The state of comparison depending on whether the inputs were valid or not.
    • delta

      public Angle delta()
      Specified by:
      delta in class TorsionAngleDelta
      Returns:
      The actual result of subtraction.
    • rangeDifference

      public RangeDifference rangeDifference()
      Specified by:
      rangeDifference in class TorsionAngleDelta
      Returns:
      The difference in terms of ranges the angles belong to.
    • withAngleType

      public final ImmutableTorsionAngleDelta withAngleType(MasterTorsionAngleType value)
      Copy the current immutable object by setting a value for the angleType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for angleType
      Returns:
      A modified copy of the this object
    • withState

      public final ImmutableTorsionAngleDelta withState(TorsionAngleDelta.State value)
      Copy the current immutable object by setting a value for the state attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for state
      Returns:
      A modified copy of the this object
    • withDelta

      public final ImmutableTorsionAngleDelta withDelta(Angle value)
      Copy the current immutable object by setting a value for the delta attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for delta
      Returns:
      A modified copy of the this object
    • withRangeDifference

      public final ImmutableTorsionAngleDelta withRangeDifference(RangeDifference value)
      Copy the current immutable object by setting a value for the rangeDifference attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for rangeDifference
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTorsionAngleDelta that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: angleType, state, delta, rangeDifference.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TorsionAngleDelta with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableTorsionAngleDelta of(MasterTorsionAngleType angleType, TorsionAngleDelta.State state, Angle delta, RangeDifference rangeDifference)
      Construct a new immutable TorsionAngleDelta instance.
      Parameters:
      angleType - The value for the angleType attribute
      state - The value for the state attribute
      delta - The value for the delta attribute
      rangeDifference - The value for the rangeDifference attribute
      Returns:
      An immutable TorsionAngleDelta instance
    • copyOf

      public static ImmutableTorsionAngleDelta copyOf(TorsionAngleDelta instance)
      Creates an immutable copy of a TorsionAngleDelta 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 TorsionAngleDelta instance
    • builder

      public static ImmutableTorsionAngleDelta.Builder builder()
      Creates a builder for ImmutableTorsionAngleDelta.
       ImmutableTorsionAngleDelta.builder()
          .angleType(pl.poznan.put.torsion.MasterTorsionAngleType) // required angleType
          .state(pl.poznan.put.torsion.TorsionAngleDelta.State) // required state
          .delta(pl.poznan.put.circular.Angle) // required delta
          .rangeDifference(pl.poznan.put.torsion.range.RangeDifference) // required rangeDifference
          .build();
       
      Returns:
      A new ImmutableTorsionAngleDelta builder