Interface PropertyMetadata


public interface PropertyMetadata
Contains metadata about a function property, a function operation parameter or a function operation return value. The access to the function properties is a bitmap value of ACCESS metadata key. Function properties can be accessed in three ways. Any combinations between them are possible:
  • ACCESS_READABLE - available for all properties, which can be read. Function must provide a getter method for an access to the property value.
  • ACCESS_WRITABLE - available for all properties, which can be modified. Function must provide a setter method for a modification of the property value.
  • ACCESS_EVENTABLE - available for all properties, which can report the property value. FunctionEvents are sent on property change.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Metadata key, which value represents the access to the function property.
    static final int
    Marks the eventable function properties.
    static final int
    Marks the readable function properties.
    static final int
    Marks the writable function properties.
    static final String
    Metadata key, which value represents the property description.
    static final String
    Metadata key, which value represents the property supported units.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the property possible values according to the specified unit.
    Returns the property maximum value according to the specified unit.
    Returns metadata about the function property or operation parameter.
    Returns the property minimum value according to the specified unit.
    Returns the difference between two values in series.
  • Field Details

    • ACCESS_READABLE

      static final int ACCESS_READABLE
      Marks the readable function properties. The flag can be used as a part of bitmap value of ACCESS. The readable access mandates function to provide a property getter method.
      See Also:
    • ACCESS_WRITABLE

      static final int ACCESS_WRITABLE
      Marks the writable function properties. The flag can be used as a part of bitmap value of ACCESS. The writable access mandates function to provide a property setter methods.
      See Also:
    • ACCESS_EVENTABLE

      static final int ACCESS_EVENTABLE
      Marks the eventable function properties. The flag can be used as a part of bitmap value of ACCESS.
      See Also:
    • ACCESS

      static final String ACCESS
      Metadata key, which value represents the access to the function property. The property value is a bitmap of Integer type. The bitmap can be any combination of: For example, value Integer(3) means that the property is readable and writable, but not eventable.

      The property access is available only for function properties and it's missing for the operation parameters.

      See Also:
    • DESCRIPTION

      static final String DESCRIPTION
      Metadata key, which value represents the property description. The property value type is java.lang.String.
      See Also:
    • UNITS

      static final String UNITS
      Metadata key, which value represents the property supported units. The property value type is java.lang.String[]. The array first element at index 0 represents the default unit. Each unit must follow those rules:
      • The International System of Units must be used where it's applicable. For example, kg for kilogram and km for kilometer.
      • If the unit name matches to an Unicode symbol name, the Unicode symbol must be used. For example, the degree unit matches to the Unicode degree sign (°).
      • If the unit name doesn't match to an Unicode symbol, the unit symbol must be built by Unicode Basic Latin block of characters, superscript and subscript characters. For example, watt per square meter steradian is built by W/(m² sr).
      If those rules cannot be applied to the unit symbol, custom rules are allowed. A set of predefined unit symbols are available in SIUnits interface.
      See Also:
  • Method Details

    • getMetadata

      Map<String,?> getMetadata(String unit)
      Returns metadata about the function property or operation parameter. The keys of the java.util.Map result must be of java.lang.String type. Possible keys:
      • DESCRIPTION - doesn't depend on the given unit.
      • ACCESS - available only for function property and missing for function operation parameters. It doesn't depend on the given unit.
      • UNITS - doesn't depend on the given unit.
      • custom key - can depend on the unit. Organizations that want to use custom keys that do not clash with OSGi Working Group defined should prefix their keys in own namespace.
      Parameters:
      unit - The unit to align the metadata if it's applicable. It can be null, which means that the default unit will be used.
      Returns:
      The property metadata or null if no such metadata is available.
    • getStep

      FunctionData getStep(String unit)
      Returns the difference between two values in series. For example, if the range is [0, 100], the step can be 10.
      Parameters:
      unit - The unit to align the step, can be null.
      Returns:
      The step according to the specified unit or null if no step is supported.
      Throws:
      IllegalArgumentException - If the unit is not supported.
    • getEnumValues

      FunctionData[] getEnumValues(String unit)
      Returns the property possible values according to the specified unit. If the unit is null, the values set is aligned to the default unit. If there is no such set of supported values, null is returned. The values must be sorted in increasing order.
      Parameters:
      unit - The unit to align the supported values, can be null.
      Returns:
      The supported values according to the specified unit or null if no such values are supported. The values must be sorted in increasing order.
      Throws:
      IllegalArgumentException - If the unit is not supported.
    • getMinValue

      FunctionData getMinValue(String unit)
      Returns the property minimum value according to the specified unit. If the unit is null, the minimum value is aligned to the default unit. If there is no minimum value, null is returned.
      Parameters:
      unit - The unit to align the minimum value, can be null .
      Returns:
      The minimum value according to the specified unit or null if no minimum value is supported.
      Throws:
      IllegalArgumentException - If the unit is not supported.
    • getMaxValue

      FunctionData getMaxValue(String unit)
      Returns the property maximum value according to the specified unit. If the unit is null, the maximum value is aligned to the default unit. If there is no maximum value, null is returned.
      Parameters:
      unit - The unit to align the maximum value, can be null .
      Returns:
      The maximum value according to the specified unit or null if no maximum value is supported.
      Throws:
      IllegalArgumentException - If the unit is not supported.