Record Class RootVariableSource<Entity_,Value_>

java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.variable.declarative.RootVariableSource<Entity_,Value_>

@NullMarked public record RootVariableSource<Entity_,Value_>(Class<? extends Entity_> rootEntity, List<MemberAccessor> listMemberAccessors, BiConsumer<Object,Consumer<Value_>> valueEntityFunction, List<VariableSourceReference> variableSourceReferences, String variablePath, ParentVariableType parentVariableType, @Nullable ParentVariableType groupParentVariableType) extends Record
  • Field Details

  • Constructor Details

    • RootVariableSource

      public RootVariableSource(Class<? extends Entity_> rootEntity, List<MemberAccessor> listMemberAccessors, BiConsumer<Object,Consumer<Value_>> valueEntityFunction, List<VariableSourceReference> variableSourceReferences, String variablePath, ParentVariableType parentVariableType, @Nullable ParentVariableType groupParentVariableType)
      Creates an instance of a RootVariableSource record class.
      Parameters:
      rootEntity - the value for the rootEntity record component
      listMemberAccessors - the value for the listMemberAccessors record component
      valueEntityFunction - the value for the valueEntityFunction record component
      variableSourceReferences - the value for the variableSourceReferences record component
      variablePath - the value for the variablePath record component
      parentVariableType - the value for the parentVariableType record component
      groupParentVariableType - the value for the groupParentVariableType record component
  • Method Details

    • pathIterator

      public static Iterator<PathPart> pathIterator(Class<?> rootEntity, String path)
    • from

      public static <Entity_, Value_> RootVariableSource<Entity_,Value_> from(PlanningSolutionMetaModel<?> solutionMetaModel, Class<? extends Entity_> rootEntityClass, String targetVariableName, String variablePath, MemberAccessorFactory memberAccessorFactory, DescriptorPolicy descriptorPolicy)
    • getEntityVisitor

      public @NonNull BiConsumer<Object,Consumer<Object>> getEntityVisitor(List<MemberAccessor> chainToEntity)
    • getMember

      public static Member getMember(Class<?> rootClass, String sourcePath, Class<?> declaringClass, String memberName)
    • isVariable

      public static boolean isVariable(PlanningSolutionMetaModel<?> metaModel, Class<?> declaringClass, String memberName)
    • toString

      public @NonNull String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rootEntity

      public Class<? extends Entity_> rootEntity()
      Returns the value of the rootEntity record component.
      Returns:
      the value of the rootEntity record component
    • listMemberAccessors

      public List<MemberAccessor> listMemberAccessors()
      Returns the value of the listMemberAccessors record component.
      Returns:
      the value of the listMemberAccessors record component
    • valueEntityFunction

      public BiConsumer<Object,Consumer<Value_>> valueEntityFunction()
      Returns the value of the valueEntityFunction record component.
      Returns:
      the value of the valueEntityFunction record component
    • variableSourceReferences

      public List<VariableSourceReference> variableSourceReferences()
      Returns the value of the variableSourceReferences record component.
      Returns:
      the value of the variableSourceReferences record component
    • variablePath

      public String variablePath()
      Returns the value of the variablePath record component.
      Returns:
      the value of the variablePath record component
    • parentVariableType

      public ParentVariableType parentVariableType()
      Returns the value of the parentVariableType record component.
      Returns:
      the value of the parentVariableType record component
    • groupParentVariableType

      public @Nullable ParentVariableType groupParentVariableType()
      Returns the value of the groupParentVariableType record component.
      Returns:
      the value of the groupParentVariableType record component