Class ImmutableNodeReplacement

java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableNodeReplacement
All Implemented Interfaces:
MutationPolicy, NodeReplacement

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableNodeReplacement extends Object implements NodeReplacement
Immutable implementation of NodeReplacement.

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

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
  • Constructor Details

    • ImmutableNodeReplacement

      private ImmutableNodeReplacement(double populationMutationProbability)
  • Method Details

    • populationMutationProbability

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

      public final ImmutableNodeReplacement 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 ImmutableNodeReplacement 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, ImmutableNodeReplacement 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 NodeReplacement with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

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

      private static ImmutableNodeReplacement validate(ImmutableNodeReplacement instance)
    • copyOf

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

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