Class ImmutableFloatChromosomeSpec

java.lang.Object
net.bmahe.genetics4j.core.spec.chromosome.FloatChromosomeSpec
net.bmahe.genetics4j.core.spec.chromosome.ImmutableFloatChromosomeSpec
All Implemented Interfaces:
ChromosomeSpec

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableFloatChromosomeSpec extends FloatChromosomeSpec
Immutable implementation of FloatChromosomeSpec.

Use the builder to create immutable instances: new FloatChromosomeSpec.Builder(). Use the static factory method to create immutable instances: ImmutableFloatChromosomeSpec.of().

  • Field Details

    • size

      private final int size
    • minValue

      private final float minValue
    • maxValue

      private final float maxValue
    • distribution

      private final Distribution distribution
  • Constructor Details

    • ImmutableFloatChromosomeSpec

      private ImmutableFloatChromosomeSpec(int size, float minValue, float maxValue)
    • ImmutableFloatChromosomeSpec

      private ImmutableFloatChromosomeSpec(ImmutableFloatChromosomeSpec.Builder builder)
    • ImmutableFloatChromosomeSpec

      private ImmutableFloatChromosomeSpec(int size, float minValue, float maxValue, Distribution distribution)
  • Method Details

    • size

      public int size()
      Specified by:
      size in class FloatChromosomeSpec
      Returns:
      The value of the size attribute
    • minValue

      public float minValue()
      Specified by:
      minValue in class FloatChromosomeSpec
      Returns:
      The value of the minValue attribute
    • maxValue

      public float maxValue()
      Specified by:
      maxValue in class FloatChromosomeSpec
      Returns:
      The value of the maxValue attribute
    • distribution

      public Distribution distribution()
      Overrides:
      distribution in class FloatChromosomeSpec
      Returns:
      The value of the distribution attribute
    • withSize

      public final ImmutableFloatChromosomeSpec withSize(int value)
      Copy the current immutable object by setting a value for the size attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for size
      Returns:
      A modified copy of the this object
    • withMinValue

      public final ImmutableFloatChromosomeSpec withMinValue(float value)
      Copy the current immutable object by setting a value for the minValue attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for minValue
      Returns:
      A modified copy of the this object
    • withMaxValue

      public final ImmutableFloatChromosomeSpec withMaxValue(float value)
      Copy the current immutable object by setting a value for the maxValue attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maxValue
      Returns:
      A modified copy of the this object
    • withDistribution

      public final ImmutableFloatChromosomeSpec withDistribution(Distribution value)
      Copy the current immutable object by setting a value for the distribution attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for distribution
      Returns:
      A modified copy of the this object
    • equals

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

      private boolean equalTo(int synthetic, ImmutableFloatChromosomeSpec another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: size, minValue, maxValue, distribution.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableFloatChromosomeSpec of(int size, float minValue, float maxValue)
      Construct a new immutable FloatChromosomeSpec instance.
      Parameters:
      size - The value for the size attribute
      minValue - The value for the minValue attribute
      maxValue - The value for the maxValue attribute
      Returns:
      An immutable FloatChromosomeSpec instance
    • validate

      private static ImmutableFloatChromosomeSpec validate(ImmutableFloatChromosomeSpec instance)
    • copyOf

      public static ImmutableFloatChromosomeSpec copyOf(FloatChromosomeSpec instance)
      Creates an immutable copy of a FloatChromosomeSpec 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 FloatChromosomeSpec instance