Solution_
- the solution type, the class with the PlanningSolution
annotationpublic class FieldAccessingSolutionCloner<Solution_> extends Object implements SolutionCloner<Solution_>
Modifier and Type | Class and Description |
---|---|
protected class |
FieldAccessingSolutionCloner.FieldAccessingSolutionClonerRun |
protected static class |
FieldAccessingSolutionCloner.Unprocessed |
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<Class<?>,Boolean> |
actualValueClassDeepClonedMemoization |
protected ConcurrentMap<Class<?>,Constructor<?>> |
constructorMemoization |
protected ConcurrentMap<org.apache.commons.lang3.tuple.Pair<Field,Class<?>>,Boolean> |
fieldDeepClonedMemoization |
protected ConcurrentMap<Class<?>,List<Field>> |
fieldListMemoization |
protected SolutionDescriptor<Solution_> |
solutionDescriptor |
Constructor and Description |
---|
FieldAccessingSolutionCloner(SolutionDescriptor<Solution_> solutionDescriptor) |
Modifier and Type | Method and Description |
---|---|
Solution_ |
cloneSolution(Solution_ originalSolution)
Does a planning clone.
|
protected boolean |
isClassDeepCloned(Class<?> type) |
protected boolean |
isFieldAnEntityOrSolution(Field field,
Class<?> fieldInstanceClass) |
protected boolean |
isFieldAnEntityPropertyOnSolution(Field field,
Class<?> fieldInstanceClass) |
protected <C> Constructor<C> |
retrieveCachedConstructor(Class<C> clazz)
This method is thread-safe.
|
protected <C> List<Field> |
retrieveCachedFields(Class<C> clazz)
This method is thread-safe.
|
protected boolean |
retrieveDeepCloneDecision(Field field,
Class<?> fieldInstanceClass,
Class<?> actualValueClass)
This method is thread-safe.
|
protected boolean |
retrieveDeepCloneDecisionForActualValueClass(Class<?> actualValueClass)
This method is thread-safe.
|
protected final SolutionDescriptor<Solution_> solutionDescriptor
protected final ConcurrentMap<Class<?>,Constructor<?>> constructorMemoization
protected final ConcurrentMap<Class<?>,List<Field>> fieldListMemoization
protected final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<Field,Class<?>>,Boolean> fieldDeepClonedMemoization
protected final ConcurrentMap<Class<?>,Boolean> actualValueClassDeepClonedMemoization
public FieldAccessingSolutionCloner(SolutionDescriptor<Solution_> solutionDescriptor)
public Solution_ cloneSolution(Solution_ originalSolution)
SolutionCloner
PlanningSolution
clone must fulfill these requirements:
original
.
original
.
PlanningSolution
,
the original PlanningSolution
must remain unchanged.This method is thread-safe.
cloneSolution
in interface SolutionCloner<Solution_>
originalSolution
- never null, the original PlanningSolution
PlanningSolution
protected <C> Constructor<C> retrieveCachedConstructor(Class<C> clazz)
C
- typeclazz
- never nullprotected <C> List<Field> retrieveCachedFields(Class<C> clazz)
C
- typeclazz
- never nullprotected boolean retrieveDeepCloneDecision(Field field, Class<?> fieldInstanceClass, Class<?> actualValueClass)
field
- never nullfieldInstanceClass
- never nullactualValueClass
- never nullprotected boolean isFieldAnEntityPropertyOnSolution(Field field, Class<?> fieldInstanceClass)
protected boolean isFieldAnEntityOrSolution(Field field, Class<?> fieldInstanceClass)
protected boolean retrieveDeepCloneDecisionForActualValueClass(Class<?> actualValueClass)
actualValueClass
- never nullprotected boolean isClassDeepCloned(Class<?> type)
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.