Class DeepCloningUtils
- java.lang.Object
- 
- org.optaplanner.core.impl.domain.solution.cloner.DeepCloningUtils
 
- 
 public final class DeepCloningUtils extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description DeepCloningUtils(SolutionDescriptor<?> solutionDescriptor)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Class<?>>getDeepClonedClasses(Collection<Class<?>> entitySubclasses)booleangetDeepCloneDecision(Field field, Class<?> owningClass, Class<?> actualValueClass)Gets the deep cloning decision for a particular value assigned to a field, memoizing the result.Set<Class<?>>getDeepClonedTypeArguments(Type genericType)booleanisClassDeepCloned(Class<?> type)booleanisFieldADeepCloneProperty(Field field, Class<?> owningClass)booleanisFieldAnEntityOrSolution(Field field)Returns true iff a field represent an Entity/Solution or a collection of Entity/Solution.booleanisFieldAnEntityPropertyOnSolution(Field field, Class<?> owningClass)Return true only if a field represent an entity property on the solution class.booleanisFieldDeepCloned(Field field, Class<?> owningClass)Gets the deep cloning decision for a field.booleanisTypeArgumentDeepCloned(Type genericType)booleanretrieveDeepCloneDecisionForActualValueClass(Class<?> actualValueClass)This method is thread-safe.
 
- 
- 
- 
Constructor Detail- 
DeepCloningUtilspublic DeepCloningUtils(SolutionDescriptor<?> solutionDescriptor) 
 
- 
 - 
Method Detail- 
getDeepCloneDecisionpublic boolean getDeepCloneDecision(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 of
- owningClass- 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.
 
 - 
retrieveDeepCloneDecisionForActualValueClasspublic boolean retrieveDeepCloneDecisionForActualValueClass(Class<?> actualValueClass) This method is thread-safe.- Parameters:
- actualValueClass- never null
- Returns:
- never null
 
 - 
isFieldDeepClonedpublic boolean isFieldDeepCloned(Field field, Class<?> owningClass) Gets the deep cloning decision for a field.- Parameters:
- field- The field to get the deep cloning decision of
- owningClass- 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).
 
 - 
isFieldAnEntityPropertyOnSolutionpublic boolean isFieldAnEntityPropertyOnSolution(Field field, Class<?> owningClass) Return true only if a field represent an entity property on the solution class. An entity property is one who type is a PlanningEntity or a collection of PlanningEntity.- Parameters:
- field- The field to get the deep cloning decision of
- owningClass- The class that owns the field; can be different from the field's declaring class (ex: subclass).
- Returns:
- True only if the field is an entity property on the solution class. May return false if the field getter/setter is complex.
 
 - 
isFieldAnEntityOrSolutionpublic boolean isFieldAnEntityOrSolution(Field field) Returns true iff a field represent an Entity/Solution or a collection of Entity/Solution.- Parameters:
- field- The field to get the deep cloning decision of
- Returns:
- True only if the field represents or contains a PlanningEntity or PlanningSolution
 
 - 
isClassDeepClonedpublic boolean isClassDeepCloned(Class<?> type) 
 - 
isTypeArgumentDeepClonedpublic boolean isTypeArgumentDeepCloned(Type genericType) 
 - 
isFieldADeepClonePropertypublic boolean isFieldADeepCloneProperty(Field field, Class<?> owningClass) 
 - 
getDeepClonedTypeArgumentspublic Set<Class<?>> getDeepClonedTypeArguments(Type genericType) - Returns:
- never null
 
 - 
getDeepClonedClassespublic Set<Class<?>> getDeepClonedClasses(Collection<Class<?>> entitySubclasses) 
 
- 
 
-