Class ImmutableTrimTree
java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableTrimTree
- All Implemented Interfaces:
MutationPolicy
,TrimTree
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableTrimTree
extends Object
implements TrimTree
Immutable implementation of
TrimTree
.
Use the builder to create immutable instances:
ImmutableTrimTree.builder()
.
Use the static factory method to create immutable instances:
ImmutableTrimTree.of()
.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableTrimTree
(Optional<Integer> maxDepth) private
private
ImmutableTrimTree
(ImmutableTrimTree original, Optional<Integer> maxDepth) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTrimTree.Builder
builder()
Creates a builder forImmutableTrimTree
.static ImmutableTrimTree
Creates an immutable copy of aTrimTree
value.boolean
This instance is equal to all instances ofImmutableTrimTree
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableTrimTree another) int
hashCode()
Computes a hash code from attributes:maxDepth
.maxDepth()
Override the max depth to enforcestatic ImmutableTrimTree
Construct a new immutableTrimTree
instance.toString()
Prints the immutable valueTrimTree
with attribute values.private static ImmutableTrimTree
validate
(ImmutableTrimTree instance) final ImmutableTrimTree
withMaxDepth
(Optional<Integer> value) Copy the current immutable object by setting a value for themaxDepth
attribute.
-
Field Details
-
maxDepth
-
-
Constructor Details
-
ImmutableTrimTree
-
ImmutableTrimTree
-
ImmutableTrimTree
-
-
Method Details
-
maxDepth
Override the max depth to enforce -
withMaxDepth
Copy the current immutable object by setting a value for themaxDepth
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxDepth- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableTrimTree
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:maxDepth
. -
toString
Prints the immutable valueTrimTree
with attribute values. -
of
Construct a new immutableTrimTree
instance.- Parameters:
maxDepth
- The value for themaxDepth
attribute- Returns:
- An immutable TrimTree instance
-
validate
-
copyOf
Creates an immutable copy of aTrimTree
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 TrimTree instance
-
builder
Creates a builder forImmutableTrimTree
.ImmutableTrimTree.builder() .maxDepth(Optional<Integer>) // optional
maxDepth
.build();- Returns:
- A new ImmutableTrimTree builder
-