Class GizmoSolutionClonerImplementor

java.lang.Object
ai.timefold.solver.core.impl.domain.solution.cloner.gizmo.GizmoSolutionClonerImplementor

public class GizmoSolutionClonerImplementor extends Object
  • 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

      public static Comparator<Class<?>> getInstanceOfComparator(Set<Class<?>> deepClonedClassSet)
      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

      public static boolean isCloneableClass(Class<?> clazz)
    • 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

      protected String getEntityHelperMethodName(Class<?> entityClass)
    • 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 BytecodeCreator outside 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)