Class EnumerationEntryInfo

java.lang.Object
com.ptc.core.lwc.common.dynamicEnum.EnumerationEntryInfo

public final class EnumerationEntryInfo extends Object
This class represents an enumeration entry. It contains the properties of the enumeration entry. There is a unique name for each enumeration entry. This class is not thread safe and should not be modified after handing it off to other code.
Note: All localizable properties should be get/set using getLocalizablePropertyValue(java.lang.String, java.util.Locale) and setLocalizableProperty(java.lang.String, java.util.Locale, java.lang.String). All non-localizable properties should be get/set using getNonLocalizablePropertyValue(java.lang.String) and setNonLocalizableProperty(java.lang.String, java.lang.Object).
Note: For all non-localizable properties, if the datatype does not match the documented datatype an error will be logged and an empty enumeration will be used.

Supported API: true

Extendable: false
  • Field Details

    • DISPLAY_NAME

      public static final String DISPLAY_NAME
      The display name for the enumeration entry. This a the localizable property.

      Supported API: true
      See Also:
    • DESCRIPTION

      public static final String DESCRIPTION
      The description for the enumeration entry. This is a localizable property.

      Supported API: true
      See Also:
    • TOOLTIP

      public static final String TOOLTIP
      The tooltip for the enumeration entry. This is a localizable property.

      Supported API: true
      See Also:
    • SELECTABLE

      public static final String SELECTABLE
      Defines whether or not the entry should be selectable. This is a non-localizable property. The value for this key should be a Boolean. If this property is not set, it will default to true.

      Supported API: true
      See Also:
    • SORT_ORDER

      public static final String SORT_ORDER
      Defines the sort order for the enumeration entry. (lowest to highest) Ignored if EnumerationInfo.AUTO_SORT is true on the enumeration. This is a non-localizable property. The value for this key should be an Integer. If this property is not set, it will default to Integer.MAX_VALUE/2.

      Supported API: true
      See Also:
  • Constructor Details

    • EnumerationEntryInfo

      public EnumerationEntryInfo(String entryKey)
      Constructor

      Supported API: true
      Parameters:
      entryKey - The name of the enumeration entry. Only letters, numbers, '.', and '_' characters are allowed.
      Throws:
      IllegalArgumentException - This exception is thrown when the given entryKey is null or an empty string.
  • Method Details

    • getName

      public String getName()
      Get the name of this enumeration entry

      Supported API: true
      Returns:
    • getNonLocalizablePropertyNames

      public Set<String> getNonLocalizablePropertyNames()
      Get all non-localizable property names that have values defined for this EnumerationEntryInfo.

      Supported API: true
      Returns:
      Set
    • getLocalizablePropertyNames

      public Set<String> getLocalizablePropertyNames()
      Get all localizable property names that have values defined for this EnumerationEntryInfo.

      Supported API: true
      Returns:
      Set
    • getNonLocalizablePropertyValue

      public Object getNonLocalizablePropertyValue(String propertyName)
      Given the property name, return the property value. Null is returned when there is no such property value.

      Supported API: true
      Parameters:
      propertyName -
      Returns:
      A property value
    • getLocalizablePropertyValue

      public String getLocalizablePropertyValue(String propertyName, Locale locale)
      Given the property name and local, return the localizable property value. Null is returned when there is no such property value.

      Supported API: true
      Parameters:
      propertyName -
      locale -
      Returns:
      A localizable property value
    • setNonLocalizableProperty

      public void setNonLocalizableProperty(String propertyName, Object value)
      Set the non localizable property value based on the given property name and value. When a null value is given, the original property value is removed.

      Supported API: true
      Parameters:
      propertyName - The non localizable property name. It must not be null.
      value - The non localizable property value. If the null value is given, the original property value is removed. This none-null value object must match the datatype of the given property name specified.
      Throws:
      IllegalArgumentException - This exception is thrown when the given propertyName is null or an empty string. When the property value object datatype doesn't match the property name specified, this exception also is thrown.
    • setLocalizableProperty

      public void setLocalizableProperty(String propertyName, Locale locale, String value)
      Set the localizable property value based on the given property name, locale and value. When a null value is given, the original property value is removed.

      Supported API: true
      Parameters:
      propertyName - The localizable property. It must not be null.
      locale - The locale for this given localizable property value. It must not be null.
      value - The localizable property value. It the null value is given, the original property value is removed.
      Throws:
      IllegalArgumentException - This exception is thrown when the given name or the given locale is null, or the given name is an empty string.