Interface PlanningEntityMetaModel<Solution_,Entity_>
- Type Parameters:
Solution_- The solution type.Entity_- The entity type.
- All Known Subinterfaces:
GenuineEntityMetaModel<Solution_,,Entity_> ShadowEntityMetaModel<Solution_,Entity_>
- All Known Implementing Classes:
DefaultGenuineEntityMetaModel,DefaultShadowEntityMetaModel
@NullMarked
public sealed interface PlanningEntityMetaModel<Solution_,Entity_>
permits GenuineEntityMetaModel<Solution_,Entity_>, ShadowEntityMetaModel<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 Neighborhoods 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 or to Timefold Discord.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasVariable(String variableName) Checks whether a variable is present on the entity.default booleanReturns whether the entity declares any genuine variables.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.default <Value_> VariableMetaModel<Solution_,Entity_, Value_> As defined byvariable(String), but only succeeds if the variable is of a given type.List<? extends VariableMetaModel<Solution_,Entity_, ?>> 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<? extends VariableMetaModel<Solution_,Entity_, variables()?>> Returns the variables declared by the entity, both genuine and shadow.- Returns:
- Variables declared by the entity.
-
variable
Returns aVariableMetaModelfor a variable with the given name. Forgenuine entities, useGenuineEntityMetaModel.genuineVariable(String)orGenuineEntityMetaModel.listVariable(String)when possible.- Returns:
- A variable declared by the entity.
-
variable
default <Value_> VariableMetaModel<Solution_,Entity_, variableValue_> (String variableName, Class<Value_> variableClass) As defined byvariable(String), but only succeeds if the variable is of a given type. Forgenuine entities, useGenuineEntityMetaModel.genuineVariable(String, Class)orGenuineEntityMetaModel.listVariable(String, Class)when possible.- Returns:
- A variable declared by the entity.
-
hasVariable
Checks whether a variable is present on the entity.- Returns:
- True if present, false otherwise.
- See Also:
-
isGenuine
default boolean isGenuine()Returns whether the entity declares any genuine variables.- Returns:
- true if the entity declares any genuine variables, false otherwise.
-