Class ImmutableSinglePointArithmetic

java.lang.Object
net.bmahe.genetics4j.core.spec.combination.SinglePointArithmetic
net.bmahe.genetics4j.core.spec.combination.ImmutableSinglePointArithmetic
All Implemented Interfaces:
CombinationPolicy

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

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

  • Field Details

    • alpha

      private final double alpha
  • Constructor Details

    • ImmutableSinglePointArithmetic

      private ImmutableSinglePointArithmetic(ImmutableSinglePointArithmetic.Builder builder)
    • ImmutableSinglePointArithmetic

      private ImmutableSinglePointArithmetic(double alpha)
  • Method Details

    • alpha

      public double alpha()
      Overrides:
      alpha in class SinglePointArithmetic
      Returns:
      The value of the alpha attribute
    • withAlpha

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableSinglePointArithmetic 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, ImmutableSinglePointArithmetic another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: alpha.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableSinglePointArithmetic of(double alpha)
      Construct a new immutable SinglePointArithmetic instance.
      Parameters:
      alpha - The value for the alpha attribute
      Returns:
      An immutable SinglePointArithmetic instance
    • copyOf

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

      public static ImmutableSinglePointArithmetic.Builder builder()
      Creates a builder for ImmutableSinglePointArithmetic.
       ImmutableSinglePointArithmetic.builder()
          .alpha(double) // optional alpha
          .build();
       
      Returns:
      A new ImmutableSinglePointArithmetic builder