Interface PlanningEntityMetaModel<Solution_,Entity_>
- Type Parameters:
Solution_- The solution type.Entity_- The entity type.
- All Known Implementing Classes:
DefaultPlanningEntityMetaModel
@NullMarked
public interface PlanningEntityMetaModel<Solution_,Entity_>
Represents the meta-model of an entity.
Gives access to the entity's variable meta-models.
This package and all of its contents are part of the Move Streams API, which is under development and is only offered as a preview feature. There are no guarantees for backward compatibility; any class, method, or field may change or be removed without prior notice, although we will strive to avoid this as much as possible.
We encourage you to try the API and give us feedback on your experience with it, before we finalize the API. Please direct your feedback to Timefold Solver Github.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <Value_> GenuineVariableMetaModel<Solution_,Entity_, Value_> Returns a single genuine variable declared by the entity.default <Value_> GenuineVariableMetaModel<Solution_,Entity_, Value_> genuineVariable(String variableName) Returns aPlanningVariableMetaModelfor a variable with the given name.default List<GenuineVariableMetaModel<Solution_,Entity_, ?>> Returns the genuine variables declared by the entity.default booleanhasVariable(String variableName) Checks whether a variable is present on the entity.default booleanReturns whether the entity declares any genuine variables.default <Value_> PlanningListVariableMetaModel<Solution_,Entity_, Value_> planningListVariable(String variableName) As defined byvariable(String), but only succeeds if the variable is aplanning list variable.default <Value_> PlanningVariableMetaModel<Solution_,Entity_, Value_> planningVariable(String variableName) As defined byvariable(String), but only succeeds if the variable is abasic planning variable.default <Value_> ShadowVariableMetaModel<Solution_,Entity_, Value_> shadowVariable(String variableName) As defined byvariable(String), but only succeeds if the variable is a shadow variable}.solution()Describes thePlanningSolutionthat owns this entity.type()Returns the most specific class of the entity.default <Value_> VariableMetaModel<Solution_,Entity_, Value_> Returns aVariableMetaModelfor a variable with the given name.Returns the variables declared by the entity, both genuine and shadow.
-
Method Details
-
solution
PlanningSolutionMetaModel<Solution_> solution()Describes thePlanningSolutionthat owns this entity.- Returns:
- never null, the solution meta-model.
-
type
Returns the most specific class of the entity.- Returns:
- The entity type.
-
variables
List<VariableMetaModel<Solution_,Entity_, variables()?>> Returns the variables declared by the entity, both genuine and shadow.- Returns:
- Variables declared by the entity.
-
genuineVariables
Returns the genuine variables declared by the entity.- Returns:
- Genuine variables declared by the entity.
-
genuineVariable
Returns a single genuine variable declared by the entity.- Type Parameters:
Value_- The type of the value of the variable.- Returns:
- The single genuine variable declared by the entity.
- Throws:
IllegalStateException- if the entity declares multiple genuine variables, or none.
-
genuineVariable
default <Value_> GenuineVariableMetaModel<Solution_,Entity_, genuineVariableValue_> (String variableName) Returns aPlanningVariableMetaModelfor a variable with the given name.- Returns:
- A genuine variable declared by the entity.
- Throws:
IllegalArgumentException- if the variable does not exist on the entity, or is not genuine
-
variable
Returns aVariableMetaModelfor a variable with the given name.- Returns:
- A variable declared by the entity.
- Throws:
IllegalArgumentException- wherehasVariable(String)would have returned false.
-
hasVariable
Checks whether a variable is present on the entity.- Returns:
- True if present, false otherwise.
- See Also:
-
planningVariable
default <Value_> PlanningVariableMetaModel<Solution_,Entity_, planningVariableValue_> (String variableName) As defined byvariable(String), but only succeeds if the variable is abasic planning variable. -
planningListVariable
default <Value_> PlanningListVariableMetaModel<Solution_,Entity_, planningListVariableValue_> (String variableName) As defined byvariable(String), but only succeeds if the variable is aplanning list variable. -
shadowVariable
default <Value_> ShadowVariableMetaModel<Solution_,Entity_, shadowVariableValue_> (String variableName) As defined byvariable(String), but only succeeds if the variable is a shadow variable}. -
isGenuine
default boolean isGenuine()Returns whether the entity declares any genuine variables.- Returns:
- true if the entity declares any genuine variables, false otherwise.
-