Record Class DefaultShadowVariableMetaModel<Solution_,Entity_,Value_>

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

@NullMarked public record DefaultShadowVariableMetaModel<Solution_,Entity_,Value_>(PlanningEntityMetaModel<Solution_,Entity_> entity, ShadowVariableDescriptor<Solution_> variableDescriptor) extends Record implements ShadowVariableMetaModel<Solution_,Entity_,Value_>, InnerVariableMetaModel<Solution_>
  • Constructor Details

    • DefaultShadowVariableMetaModel

      public DefaultShadowVariableMetaModel(PlanningEntityMetaModel<Solution_,Entity_> entity, ShadowVariableDescriptor<Solution_> variableDescriptor)
      Creates an instance of a DefaultShadowVariableMetaModel 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
    • variableDescriptor

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