Class DeepCloningUtils
- java.lang.Object
-
- ai.timefold.solver.core.impl.domain.solution.cloner.DeepCloningUtils
-
public final class DeepCloningUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisClassDeepCloned(SolutionDescriptor<?> solutionDescriptor, Class<?> type)static booleanisDeepCloned(SolutionDescriptor<?> solutionDescriptor, Field field, Class<?> owningClass, Class<?> actualValueClass)Gets the deep cloning decision for a particular value assigned to a field, memoizing the result.static booleanisFieldDeepCloned(SolutionDescriptor<?> solutionDescriptor, Field field, Class<?> owningClass)Gets the deep cloning decision for a field.
-
-
-
Method Detail
-
isDeepCloned
public static boolean isDeepCloned(SolutionDescriptor<?> solutionDescriptor, Field field, Class<?> owningClass, Class<?> actualValueClass)
Gets the deep cloning decision for a particular value assigned to a field, memoizing the result.- Parameters:
field- the field to get the deep cloning decision ofowningClass- the class that owns the field; can be different from the field's declaring class (ex: subclass)actualValueClass- the class of the value that is currently assigned to the field; can be different from the field type (ex: for the field "List myList", the actual value class might be ArrayList).- Returns:
- true iff the field should be deep cloned with a particular value.
-
isFieldDeepCloned
public static boolean isFieldDeepCloned(SolutionDescriptor<?> solutionDescriptor, Field field, Class<?> owningClass)
Gets the deep cloning decision for a field.- Parameters:
field- The field to get the deep cloning decision ofowningClass- The class that owns the field; can be different from the field's declaring class (ex: subclass).- Returns:
- True iff the field should always be deep cloned (regardless of value).
-
isClassDeepCloned
public static boolean isClassDeepCloned(SolutionDescriptor<?> solutionDescriptor, Class<?> type)
-
-