Class Variable


  • public class Variable
    extends IdentifiableNamedResource
    A moderator defined variable for which a value can be set on a Run.

    This class is immutable and thread-safe.
    • Method Detail

      • getScope

        public VariableScope getScope()
        Gets the VariableScope where this variable is usable.
        Returns:
        a VariableScope of this variable
      • isMandatory

        public boolean isMandatory()
        Gets whether the User submitting a run is required to set a value for this variable.
        Returns:
        true if this variable is required, false otherwise
      • isUserDefined

        public boolean isUserDefined()
        Gets whether the User submitting a run can enter custom values for this variable.
        Returns:
        true if this variable can have custom values, false otherwise
      • isObsoleting

        public boolean isObsoleting()
        Gets whether this variable having different values prevents runs from being obsoleted.
        Returns:
        true if runs will be obsolete even if they have different values for this variable, false otherwise
      • getValues

        public Map<String,​VariableValue> getValues()
        Gets a Map to map variable value IDs to a VariableValue.
        Returns:
        an unmodifiable Map with keys being variable value IDs, and values being VariableValue
      • getDefaultValue

        public Optional<String> getDefaultValue()
        Gets the default value ID for this variable.
        Returns:
        the default value ID to use
      • isSubcategory

        public boolean isSubcategory()
        Gets whether this variable is handled as a subcategory.
        Returns:
        true if this variable is a subcategory, false otherwise