Class ImmutableProgramTreeChromosomeSpec

java.lang.Object
net.bmahe.genetics4j.gp.spec.chromosome.ProgramTreeChromosomeSpec
net.bmahe.genetics4j.gp.spec.chromosome.ImmutableProgramTreeChromosomeSpec
All Implemented Interfaces:
ChromosomeSpec

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

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

  • Field Details

    • program

      private final Program program
  • Constructor Details

    • ImmutableProgramTreeChromosomeSpec

      private ImmutableProgramTreeChromosomeSpec(Program program)
    • ImmutableProgramTreeChromosomeSpec

      private ImmutableProgramTreeChromosomeSpec(ImmutableProgramTreeChromosomeSpec original, Program program)
  • Method Details

    • program

      public Program program()
      Specified by:
      program in class ProgramTreeChromosomeSpec
      Returns:
      The value of the program attribute
    • withProgram

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

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

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

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

      public static ImmutableProgramTreeChromosomeSpec of(Program program)
      Construct a new immutable ProgramTreeChromosomeSpec instance.
      Parameters:
      program - The value for the program attribute
      Returns:
      An immutable ProgramTreeChromosomeSpec instance
    • copyOf

      Creates an immutable copy of a ProgramTreeChromosomeSpec 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 ProgramTreeChromosomeSpec instance
    • builder

      Creates a builder for ImmutableProgramTreeChromosomeSpec.
       ImmutableProgramTreeChromosomeSpec.builder()
          .program(net.bmahe.genetics4j.gp.program.Program) // required program
          .build();
       
      Returns:
      A new ImmutableProgramTreeChromosomeSpec builder