Annotation Type PiggybackShadowVariable


  • @Target({METHOD,FIELD})
    @Retention(RUNTIME)
    public @interface PiggybackShadowVariable
    Specifies that a bean property (or a field) is a custom shadow variable that is updated by another shadow variable's variable listener.

    It is specified on a getter of a java bean property (or a field) of a PlanningEntity class.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String shadowVariableName
      The shadow variable name.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?> shadowEntityClass
      The PlanningEntity class of the shadow variable with a variable listener.
    • Element Detail

      • shadowVariableName

        String shadowVariableName
        The shadow variable name.
        Returns:
        never null, a genuine or shadow variable name
      • shadowEntityClass

        Class<?> shadowEntityClass
        The PlanningEntity class of the shadow variable with a variable listener.

        Specified if the referenced shadow variable is on a different Class than the class that uses this annotation.

        Returns:
        PiggybackShadowVariable.NullEntityClass when it is null (workaround for annotation limitation). Defaults to the same Class as the one that uses this annotation.
        Default:
        org.optaplanner.core.api.domain.variable.PiggybackShadowVariable.NullEntityClass.class