Class GizmoSolutionClonerImplementor
java.lang.Object
ai.timefold.solver.core.impl.domain.solution.cloner.gizmo.GizmoSolutionClonerImplementor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanprotected static final io.quarkus.gizmo.MethodDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateAbstractDeepCloneHelperMethod(io.quarkus.gizmo.ClassCreator classCreator, Class<?> entityClass, SolutionDescriptor<?> solutionDescriptor, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, SortedSet<Class<?>> deepClonedClassesSortedSet) static io.quarkus.gizmo.ClassOutputcreateClassOutputWithDebuggingCapability(MutableReference<byte[]> classBytecodeHolder) protected voidcreateFields(io.quarkus.gizmo.ClassCreator classCreator) protected voidcreateSetSolutionDescriptor(io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor) protected io.quarkus.gizmo.BytecodeCreatorcreateUnknownClassHandler(io.quarkus.gizmo.BytecodeCreator bytecodeCreator, SolutionDescriptor<?> solutionDescriptor, Class<?> entityClass, io.quarkus.gizmo.ResultHandle toClone, io.quarkus.gizmo.ResultHandle cloneMap) Writes the following code:static voiddefineClonerFor(io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor, Set<Class<?>> solutionClassSet, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, Set<Class<?>> deepClonedClassSet) Generates the constructor and implementations of SolutionCloner methods for the given SolutionDescriptor using the given ClassCreatorstatic voiddefineClonerFor(Supplier<GizmoSolutionClonerImplementor> implementorSupplier, io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor, Set<Class<?>> solutionClassSet, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, Set<Class<?>> deepClonedClassSet) Generates the constructor and implementations of SolutionCloner methods for the given SolutionDescriptor using the given ClassCreatorprotected StringgetEntityHelperMethodName(Class<?> entityClass) static Comparator<Class<?>>getInstanceOfComparator(Set<Class<?>> deepClonedClassSet) Return a comparator that sorts classes into instanceof check order.static booleanisCloneableClass(Class<?> clazz)
-
Field Details
-
GET_METHOD
protected static final io.quarkus.gizmo.MethodDescriptor GET_METHOD -
DEBUG
public static final boolean DEBUG- See Also:
-
-
Constructor Details
-
GizmoSolutionClonerImplementor
public GizmoSolutionClonerImplementor()
-
-
Method Details
-
getInstanceOfComparator
Return a comparator that sorts classes into instanceof check order. In particular, if x is a subclass of y, then x will appear earlier than y in the list.- Parameters:
deepClonedClassSet- The set of classes to generate a comparator for- Returns:
- A comparator that sorts classes from deepClonedClassSet such that x < y if x is assignable from y.
-
createFields
protected void createFields(io.quarkus.gizmo.ClassCreator classCreator) -
defineClonerFor
public static void defineClonerFor(io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor, Set<Class<?>> solutionClassSet, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, Set<Class<?>> deepClonedClassSet) Generates the constructor and implementations of SolutionCloner methods for the given SolutionDescriptor using the given ClassCreator -
isCloneableClass
-
defineClonerFor
public static void defineClonerFor(Supplier<GizmoSolutionClonerImplementor> implementorSupplier, io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor, Set<Class<?>> solutionClassSet, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, Set<Class<?>> deepClonedClassSet) Generates the constructor and implementations of SolutionCloner methods for the given SolutionDescriptor using the given ClassCreator -
createClassOutputWithDebuggingCapability
public static io.quarkus.gizmo.ClassOutput createClassOutputWithDebuggingCapability(MutableReference<byte[]> classBytecodeHolder) -
createSetSolutionDescriptor
protected void createSetSolutionDescriptor(io.quarkus.gizmo.ClassCreator classCreator, SolutionDescriptor<?> solutionDescriptor) -
getEntityHelperMethodName
-
createUnknownClassHandler
protected io.quarkus.gizmo.BytecodeCreator createUnknownClassHandler(io.quarkus.gizmo.BytecodeCreator bytecodeCreator, SolutionDescriptor<?> solutionDescriptor, Class<?> entityClass, io.quarkus.gizmo.ResultHandle toClone, io.quarkus.gizmo.ResultHandle cloneMap) Writes the following code:In Quarkus: (nothing)
Outside Quarkus:
if (toClone.getClass() != entityClass) { Cloner.fallbackCloner.gizmoFallbackDeepClone(toClone, cloneMap); } else { ... }- Returns:
- The else branch
BytecodeCreatoroutside of Quarkus, the original bytecodeCreator otherwise.
-
createAbstractDeepCloneHelperMethod
protected void createAbstractDeepCloneHelperMethod(io.quarkus.gizmo.ClassCreator classCreator, Class<?> entityClass, SolutionDescriptor<?> solutionDescriptor, Map<Class<?>, GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap, SortedSet<Class<?>> deepClonedClassesSortedSet)
-