Record Class DefaultPlanningListVariableMetaModel<Solution_,Entity_,Value_>

java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.solution.descriptor.DefaultPlanningListVariableMetaModel<Solution_,Entity_,Value_>
All Implemented Interfaces:
InnerVariableMetaModel<Solution_>, GenuineVariableMetaModel<Solution_,Entity_,Value_>, PlanningListVariableMetaModel<Solution_,Entity_,Value_>, VariableMetaModel<Solution_,Entity_,Value_>

@NullMarked public record DefaultPlanningListVariableMetaModel<Solution_,Entity_,Value_>(PlanningEntityMetaModel<Solution_,Entity_> entity, ListVariableDescriptor<Solution_> variableDescriptor) extends Record implements PlanningListVariableMetaModel<Solution_,Entity_,Value_>, InnerVariableMetaModel<Solution_>
  • Constructor Details

    • DefaultPlanningListVariableMetaModel

      public DefaultPlanningListVariableMetaModel(PlanningEntityMetaModel<Solution_,Entity_> entity, ListVariableDescriptor<Solution_> variableDescriptor)
      Creates an instance of a DefaultPlanningListVariableMetaModel record class.
      Parameters:
      entity - the value for the entity record component
      variableDescriptor - the value for the variableDescriptor record component
  • Method Details

    • type

      public Class<Value_> type()
      Description copied from interface: VariableMetaModel
      Describes the type of the value that this variable can hold.
      Specified by:
      type in interface VariableMetaModel<Solution_,Entity_,Value_>
      Returns:
      never null
    • name

      public String name()
      Description copied from interface: VariableMetaModel
      Describes the name of this variable, which is typically a field name in the entity.
      Specified by:
      name in interface VariableMetaModel<Solution_,Entity_,Value_>
      Returns:
      never null
    • allowsUnassignedValues

      public boolean allowsUnassignedValues()
      Description copied from interface: PlanningListVariableMetaModel
      Returns whether the planning variable allows values not to be assigned to any entity's list variable.
      Specified by:
      allowsUnassignedValues in interface PlanningListVariableMetaModel<Solution_,Entity_,Value_>
      Returns:
      true if the planning variable allows unassigned values, false otherwise.
    • equals

      public 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.
    • hashCode

      public 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
    • toString

      public 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
    • entity

      Returns the value of the entity record component.
      Specified by:
      entity in interface VariableMetaModel<Solution_,Entity_,Value_>
      Returns:
      the value of the entity record component
    • variableDescriptor

      public ListVariableDescriptor<Solution_> variableDescriptor()
      Returns the value of the variableDescriptor record component.
      Specified by:
      variableDescriptor in interface InnerVariableMetaModel<Solution_>
      Returns:
      the value of the variableDescriptor record component