Class AbstractJPPFProperty<T>

java.lang.Object
org.jppf.utils.configuration.AbstractJPPFProperty<T>
Type Parameters:
T - the type of the value of this property.
All Implemented Interfaces:
Serializable, JPPFProperty<T>
Direct Known Subclasses:
BooleanProperty, CharProperty, FileProperty, IntArrayProperty, NumberProperty, StringArrayProperty, StringProperty

public abstract class AbstractJPPFProperty<T> extends Object implements JPPFProperty<T>
Abstract implementation of the JPPFProperty interface.
Since:
5.2
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • AbstractJPPFProperty

      public AbstractJPPFProperty(String name, T defaultValue, String... aliases)
      Initialize this property with the specified name and default value.
      Parameters:
      name - the name of this property.
      defaultValue - the default value of this property, used when the proeprty is not defined.
      aliases - other names that may be given to this property (e.g. older names from previous versions).
  • Method Details

    • getName

      public String getName()
      Description copied from interface: JPPFProperty
      Get the name of this property.
      Specified by:
      getName in interface JPPFProperty<T>
      Returns:
      the property's name.
    • getDefaultValue

      public T getDefaultValue()
      Description copied from interface: JPPFProperty
      Get the default value of this property.
      Specified by:
      getDefaultValue in interface JPPFProperty<T>
      Returns:
      the default value;
    • getAliases

      public String[] getAliases()
      Description copied from interface: JPPFProperty
      Get the aliases for this property, that is, other names it may be known as such as legacy names from prior versions.
      Specified by:
      getAliases in interface JPPFProperty<T>
      Returns:
      an array of the aliases for this property, possibly empty.
    • toString

      public String toString(T value)
      Description copied from interface: JPPFProperty
      Convert the specified value to a string.
      Specified by:
      toString in interface JPPFProperty<T>
      Parameters:
      value - the property value to convert.
      Returns:
      a String representation of the value.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPossibleValues

      public T[] getPossibleValues()
      Get the possible values for this property, if any is defined.
      Returns:
      an array of the possible values.
    • setPossibleValues

      public JPPFProperty<T> setPossibleValues(T... possibleValues)
      Set the possible values for this property.
      Parameters:
      possibleValues - an array of the possible values.
      Returns:
      this property.
    • getDocumentation

      public String getDocumentation()
      Description copied from interface: JPPFProperty
      Get a description of this property.
      Specified by:
      getDocumentation in interface JPPFProperty<T>
      Returns:
      the description as a string.
    • getDocumentation

      public String getDocumentation(Locale locale)
      Description copied from interface: JPPFProperty
      Get a description of this property.
      Specified by:
      getDocumentation in interface JPPFProperty<T>
      Parameters:
      locale - the locale in which the documentation of this property should be returned.
      Returns:
      the description as a string.
    • getShortLabel

      public String getShortLabel()
      Description copied from interface: JPPFProperty
      Get a short label for this property.
      Specified by:
      getShortLabel in interface JPPFProperty<T>
      Returns:
      the label as a string.
    • getShortLabel

      public String getShortLabel(Locale locale)
      Description copied from interface: JPPFProperty
      Get a short label for this property.
      Specified by:
      getShortLabel in interface JPPFProperty<T>
      Parameters:
      locale - the locale in which the short label of this property should be returned.
      Returns:
      the label as a string.
    • getTags

      public Set<String> getTags()
      Description copied from interface: JPPFProperty
      Get the set of tags that apply to this property.
      Specified by:
      getTags in interface JPPFProperty<T>
      Returns:
      a set of tags as strings.
    • getParameters

      public String[] getParameters()
      Description copied from interface: JPPFProperty
      Get the parmaeters specified in the name of property, if any. Parameters are specified as in this example: my.<param1>.property.<param2>.name = some value.
      Specified by:
      getParameters in interface JPPFProperty<T>
      Returns:
      an array of the parameter names, empty if there is no parameter.
    • getParameterDoc

      public String getParameterDoc(String param)
      Description copied from interface: JPPFProperty
      Get the documeentation for the specified parmaeter, if it exists.
      Specified by:
      getParameterDoc in interface JPPFProperty<T>
      Parameters:
      param - the name of the parameter for which to find a description.
      Returns:
      a string describing the parameter.
    • resolveName

      public String resolveName(String... params)
      Description copied from interface: JPPFProperty
      Resolve the name of the property by substituting the parameters names with actual values.
      Specified by:
      resolveName in interface JPPFProperty<T>
      Parameters:
      params - the values of the parameters.
      Returns:
      the new resolve name.
    • resolveName

      public String resolveName(String alias, String... params)
      Description copied from interface: JPPFProperty
      Resolve the specified alias for the property's name by substituting the parameters names with actual values.
      Specified by:
      resolveName in interface JPPFProperty<T>
      Parameters:
      alias - the alias to resolve.
      params - the values of the parameters.
      Returns:
      the new resolve name.
    • getI18nBase

      public String getI18nBase()
      Returns:
      the location of the localization resource bundles.
    • setI18nBase

      public void setI18nBase(String i18nBase)
      Set the location of the localization resource bundles.
      Parameters:
      i18nBase - the location to set.
    • isDeprecated

      public boolean isDeprecated()
      Description copied from interface: JPPFProperty
      Determine whether this property is deprecated.
      Specified by:
      isDeprecated in interface JPPFProperty<T>
      Returns:
      true if the property is deprecated, false otherwise.
    • setDeprecated

      public JPPFProperty<T> setDeprecated(boolean deprecated)
      Description copied from interface: JPPFProperty
      Specify whether this property is deprecated.
      Specified by:
      setDeprecated in interface JPPFProperty<T>
      Parameters:
      deprecated - true if the property is deprecated, false otherwise.
      Returns:
      this property, for method call chaining.
    • getDeprecatedDoc

      public String getDeprecatedDoc()
      Description copied from interface: JPPFProperty
      Get a string explaining why a property was deprecated and/or what to use instead.
      Specified by:
      getDeprecatedDoc in interface JPPFProperty<T>
      Returns:
      a text documentation about this property's deprecation.
    • getDeprecatedDoc

      public String getDeprecatedDoc(Locale locale)
      Description copied from interface: JPPFProperty
      Get a string explaining why a property was deprecated and/or what to use instead.
      Specified by:
      getDeprecatedDoc in interface JPPFProperty<T>
      Parameters:
      locale - the locale in which the text should be returned.
      Returns:
      a text documentation about this property's deprecation.