Class AbstractObjectEnumeration

java.lang.Object
com.polarion.platform.persistence.spi.AbstractObjectEnumeration
All Implemented Interfaces:
IEnumeration, IObjectEnumeration

public abstract class AbstractObjectEnumeration extends Object implements IObjectEnumeration
Since:
3.6.3
  • Constructor Details

    • AbstractObjectEnumeration

      public AbstractObjectEnumeration(String enumId)
  • Method Details

    • wrapOption

      public IEnumOption wrapOption(String optionId, Object controlValue)
      Description copied from interface: IEnumeration
      Wraps any given ID into a valid option of this enumeration.

      This method checks only the option definition for given controlValue (even if null). If no definition is found, then phantom option is created.

      Specified by:
      wrapOption in interface IEnumeration
      Parameters:
      optionId - option id (not null)
      controlValue - control value
      Returns:
      the option wrapped as an IEnumOption (not null)
      See Also:
    • wrapOption

      public IEnumOption wrapOption(String optionId, IPObject pobject)
      Description copied from interface: IEnumeration
      Wraps any given ID into a valid option of this enumeration.

      This method checks only the option definition applicable to given object. If no definition is found, then phantom option is created.

      If pobject is not specified then it acts as IEnumeration.wrapOption(String, Object) with null control value.

      Specified by:
      wrapOption in interface IEnumeration
      Parameters:
      optionId - option id (not null)
      pobject - persistence object
      Returns:
      the option wrapped as an IEnumOption (not null)
      See Also:
    • getAvailableOptions

      public List getAvailableOptions(Object controlValue)
      Description copied from interface: IEnumeration
      Currently, the control value can be only String or IEnumOption. Passing in something else will result in UnsupportedOperationException

      Specified by:
      getAvailableOptions in interface IEnumeration
      Parameters:
      controlValue - Can be null.
      Returns:
      Sorted list of all the valid options for given control key value.
    • getControlKey

      public String getControlKey()
      Specified by:
      getControlKey in interface IEnumeration
      Returns:
      Name of the key on the object, which controls the option set of this enumeration.
    • getAllOptions

      public List getAllOptions()
      Specified by:
      getAllOptions in interface IEnumeration
      Returns:
      Sorted list of all IEnumOptions across all the control key values.
    • getDefaultOption

      public IEnumOption getDefaultOption(Object controlValue)
      Specified by:
      getDefaultOption in interface IEnumeration
      Parameters:
      controlValue - The control value, since the default value might depend on it.
      Returns:
      the default option from the enumeration
    • createPhantomOption

      @NotNull public static IEnumOption createPhantomOption(String enumId, String optionId)