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:
    Function, PropertyMetadata
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ACCESS
      Metadata key, which value represents the access to the function property.
      static int ACCESS_EVENTABLE
      Marks the eventable function properties.
      static int ACCESS_READABLE
      Marks the readable function properties.
      static int ACCESS_WRITABLE
      Marks the writable function properties.
      static java.lang.String DESCRIPTION
      Metadata key, which value represents the property description.
      static java.lang.String UNITS
      Metadata key, which value represents the property supported units.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      FunctionData[] getEnumValues​(java.lang.String unit)
      Returns the property possible values according to the specified unit.
      FunctionData getMaxValue​(java.lang.String unit)
      Returns the property maximum value according to the specified unit.
      java.util.Map<java.lang.String,​?> getMetadata​(java.lang.String unit)
      Returns metadata about the function property or operation parameter.
      FunctionData getMinValue​(java.lang.String unit)
      Returns the property minimum value according to the specified unit.
      FunctionData getStep​(java.lang.String unit)
      Returns the difference between two values in series.
    • Field Detail

      • 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:
        Function, Constant Field Values
      • 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:
        Function, Constant Field Values
      • 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:
        Function, Constant Field Values
      • ACCESS

        static final java.lang.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:
        Constant Field Values
      • DESCRIPTION

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

        static final java.lang.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:
        Constant Field Values
    • Method Detail

      • getMetadata

        java.util.Map<java.lang.String,​?> getMetadata​(java.lang.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​(java.lang.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:
        java.lang.IllegalArgumentException - If the unit is not supported.
      • getEnumValues

        FunctionData[] getEnumValues​(java.lang.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:
        java.lang.IllegalArgumentException - If the unit is not supported.
      • getMinValue

        FunctionData getMinValue​(java.lang.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:
        java.lang.IllegalArgumentException - If the unit is not supported.
      • getMaxValue

        FunctionData getMaxValue​(java.lang.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:
        java.lang.IllegalArgumentException - If the unit is not supported.