Class ImmutableProgramApplyRules
java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableProgramApplyRules
- All Implemented Interfaces:
MutationPolicy,ProgramApplyRules
@Generated(from="ProgramApplyRules",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableProgramApplyRules
extends Object
implements ProgramApplyRules
Immutable implementation of
ProgramApplyRules.
Use the builder to create immutable instances:
ImmutableProgramApplyRules.builder().
Use the static factory method to create immutable instances:
ImmutableProgramApplyRules.of().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableProgramApplyRules(Iterable<? extends Rule> rules) privateImmutableProgramApplyRules(ImmutableProgramApplyRules original, List<Rule> rules) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forProgramApplyRules.static ProgramApplyRulescopyOf(ProgramApplyRules instance) Creates an immutable copy of aProgramApplyRulesvalue.private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List<T> createUnmodifiableList(boolean clone, List<? extends T> list) booleanThis instance is equal to all instances ofImmutableProgramApplyRulesthat have equal attribute values.private booleanequalsByValue(ImmutableProgramApplyRules another) inthashCode()Computes a hash code from attributes:rules.static ProgramApplyRulesConstruct a new immutableProgramApplyRulesinstance.static ProgramApplyRulesConstruct a new immutableProgramApplyRulesinstance.rules()toString()Prints the immutable valueProgramApplyRuleswith attribute values.Copy the current immutable object with elements that replace the content ofrules.Copy the current immutable object with elements that replace the content ofrules.
-
Field Details
-
rules
-
-
Constructor Details
-
ImmutableProgramApplyRules
-
ImmutableProgramApplyRules
-
-
Method Details
-
rules
- Specified by:
rulesin interfaceProgramApplyRules- Returns:
- The value of the
rulesattribute
-
withRules
Copy the current immutable object with elements that replace the content ofrules.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withRules
Copy the current immutable object with elements that replace the content ofrules. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of rules elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableProgramApplyRulesthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:rules. -
toString
Prints the immutable valueProgramApplyRuleswith attribute values. -
of
Construct a new immutableProgramApplyRulesinstance.- Parameters:
rules- The value for therulesattribute- Returns:
- An immutable ProgramApplyRules instance
-
of
Construct a new immutableProgramApplyRulesinstance.- Parameters:
rules- The value for therulesattribute- Returns:
- An immutable ProgramApplyRules instance
-
copyOf
Creates an immutable copy of aProgramApplyRulesvalue. 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 ProgramApplyRules instance
-
builder
Creates a builder forProgramApplyRules.ImmutableProgramApplyRules.builder() .addRules|addAllRules(net.bmahe.genetics4j.gp.spec.mutation.Rule) //ruleselements .build();- Returns:
- A new ProgramApplyRules builder
-
createSafeList
-
createUnmodifiableList
-