Class ImmutableInputSpec

java.lang.Object
net.bmahe.genetics4j.gp.InputSpec
net.bmahe.genetics4j.gp.ImmutableInputSpec

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

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

  • Field Details

  • Constructor Details

  • Method Details

    • types

      public List<Class> types()
      Specified by:
      types in class InputSpec
      Returns:
      The value of the types attribute
    • withTypes

      public final ImmutableInputSpec withTypes(Class... elements)
      Copy the current immutable object with elements that replace the content of types.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTypes

      public final ImmutableInputSpec withTypes(Iterable<? extends Class> elements)
      Copy the current immutable object with elements that replace the content of types. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of types elements to set
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableInputSpec of(List<Class> types)
      Construct a new immutable InputSpec instance.
      Parameters:
      types - The value for the types attribute
      Returns:
      An immutable InputSpec instance
    • of

      public static ImmutableInputSpec of(Iterable<? extends Class> types)
      Construct a new immutable InputSpec instance.
      Parameters:
      types - The value for the types attribute
      Returns:
      An immutable InputSpec instance
    • copyOf

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

      public static ImmutableInputSpec.Builder builder()
      Creates a builder for ImmutableInputSpec.
       ImmutableInputSpec.builder()
          .addTypes|addAllTypes(Class) // types elements
          .build();
       
      Returns:
      A new ImmutableInputSpec builder
    • createSafeList

      private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls)
    • createUnmodifiableList

      private static <T> List<T> createUnmodifiableList(boolean clone, List<T> list)