java.lang.Object
java.lang.Enum<RetrievalSemantics>
org.optaplanner.constraint.streams.common.RetrievalSemantics
All Implemented Interfaces:
Serializable, Comparable<RetrievalSemantics>

public enum RetrievalSemantics extends Enum<RetrievalSemantics>
Determines the behavior of joins and conditional propagation based on whether they are coming off of a constraint stream started by either ConstraintFactory.from(Class) or ConstraintFactory.forEach(Class) family of methods.

For classes which are not planning entities, all of their instances are always retrieved. For classes which are planning entities, the difference in behavior depends on whether they use nullable planning variables. (See PlanningVariable.)

  • Enum Constant Details

    • STANDARD

      public static final RetrievalSemantics STANDARD
      Joins do not include entities with null planning variables, unless specifically requested by join(forEachIncludingNullVars(...)). Conditional propagation does not include null planning variables, unless specifically requested using a *IncludingNullVars() method overload.

      Applies when the stream comes off of a ConstraintFactory.forEach(Class) family of methods.

    • LEGACY

      @Deprecated(forRemoval=true) public static final RetrievalSemantics LEGACY
      Deprecated, for removal: This API element is subject to removal in a future version.
      this semantics is deprecated and kept around for backward compatibility reasons. It will be removed in 9.0 together with the from() family of methods, along with this entire enum.
      Joins include entities with null planning variables if these variables are nullable. Conditional propagation always includes entities with null planning variables, regardless of whether their planning variables are nullable.

      Applies when the stream comes off of a ConstraintFactory.from(Class) family of methods.

  • Method Details

    • values

      public static RetrievalSemantics[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static RetrievalSemantics valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null