Class ImmutableSwitchStateMutation

java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.SwitchStateMutation
net.bmahe.genetics4j.neat.spec.mutation.ImmutableSwitchStateMutation
All Implemented Interfaces:
MutationPolicy

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

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

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
  • Constructor Details

    • ImmutableSwitchStateMutation

      private ImmutableSwitchStateMutation(double populationMutationProbability)
  • Method Details

    • populationMutationProbability

      public double populationMutationProbability()
      Specified by:
      populationMutationProbability in class SwitchStateMutation
      Returns:
      The value of the populationMutationProbability attribute
    • withPopulationMutationProbability

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

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

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

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

      public static ImmutableSwitchStateMutation of(double populationMutationProbability)
      Construct a new immutable SwitchStateMutation instance.
      Parameters:
      populationMutationProbability - The value for the populationMutationProbability attribute
      Returns:
      An immutable SwitchStateMutation instance
    • validate

      private static ImmutableSwitchStateMutation validate(ImmutableSwitchStateMutation instance)
    • copyOf

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

      public static ImmutableSwitchStateMutation.Builder builder()
      Creates a builder for ImmutableSwitchStateMutation.
       ImmutableSwitchStateMutation.builder()
          .populationMutationProbability(double) // required populationMutationProbability
          .build();
       
      Returns:
      A new ImmutableSwitchStateMutation builder