Class ImmutableBondLength

java.lang.Object
pl.poznan.put.atom.ImmutableBondLength
All Implemented Interfaces:
BondLength

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableBondLength extends Object implements BondLength
Immutable implementation of BondLength.

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

  • Method Details

    • min

      public double min()
      Specified by:
      min in interface BondLength
      Returns:
      The minimum length.
    • max

      public double max()
      Specified by:
      max in interface BondLength
      Returns:
      The maximum length.
    • avg

      public double avg()
      Specified by:
      avg in interface BondLength
      Returns:
      The average length.
    • withMin

      public final ImmutableBondLength withMin(double value)
      Copy the current immutable object by setting a value for the min attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for min
      Returns:
      A modified copy of the this object
    • withMax

      public final ImmutableBondLength withMax(double value)
      Copy the current immutable object by setting a value for the max attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for max
      Returns:
      A modified copy of the this object
    • withAvg

      public final ImmutableBondLength withAvg(double value)
      Copy the current immutable object by setting a value for the avg attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for avg
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableBondLength 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: min, max, avg.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableBondLength of(double min, double max, double avg)
      Construct a new immutable BondLength instance.
      Parameters:
      min - The value for the min attribute
      max - The value for the max attribute
      avg - The value for the avg attribute
      Returns:
      An immutable BondLength instance
    • copyOf

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

      public static ImmutableBondLength.Builder builder()
      Creates a builder for ImmutableBondLength.
       ImmutableBondLength.builder()
          .min(double) // required min
          .max(double) // required max
          .avg(double) // required avg
          .build();
       
      Returns:
      A new ImmutableBondLength builder