Top Description Fields Methods
org.osgi.service.dal

public Interface PropertyMetadata

Imports
java.util.Map

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:
See Also
Function, PropertyMetadata

Field Summary

Modifier and TypeField and Description
public static final String
ACCESS

Metadata key, which value represents the access to the function property.

public static final int
ACCESS_EVENTABLE

Marks the eventable function properties.

public static final int
ACCESS_READABLE

Marks the readable function properties.

public static final int
ACCESS_WRITABLE

Marks the writable function properties.

public static final String
DESCRIPTION

Metadata key, which value represents the property description.

public static final String
UNITS

Metadata key, which value represents the property supported units.

Method Summary

Modifier and TypeMethod and Description
public FunctionData[]

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.
getEnumValues
(String
The unit to align the supported values, can be null.
unit
)

Returns the property possible values according to the specified unit.

public FunctionData

Returns:

The maximum value according to the specified unit or null if no maximum value is supported.
getMaxValue
(String
The unit to align the maximum value, can be null .
unit
)

Returns the property maximum value according to the specified unit.

public Map<String, ?>

Returns:

The property metadata or null if no such metadata is available.
getMetadata
(String
The unit to align the metadata if it's applicable. It can be null, which means that the default unit will be used.
unit
)

Returns metadata about the function property or operation parameter.

public FunctionData

Returns:

The minimum value according to the specified unit or null if no minimum value is supported.
getMinValue
(String
The unit to align the minimum value, can be null .
unit
)

Returns the property minimum value according to the specified unit.

public FunctionData

Returns:

The step according to the specified unit or null if no step is supported.
getStep
(String
The unit to align the step, can be null.
unit
)

Returns the difference between two values in series.

Field Detail

ACCESSback to summary
public 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.

ACCESS_EVENTABLEback to summary
public 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
ACCESS_READABLEback to summary
public 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
ACCESS_WRITABLEback to summary
public 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
DESCRIPTIONback to summary
public static final String DESCRIPTION

Metadata key, which value represents the property description. The property value type is java.lang.String.

UNITSback to summary
public 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.

Method Detail

getEnumValuesback to summary
public 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:String

The unit to align the supported values, can be null.

Returns:FunctionData[]

The supported values according to the specified unit or null if no such values are supported. The values must be sorted in increasing order.

Exceptions
IllegalArgumentException:
If the unit is not supported.
getMaxValueback to summary
public 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:String

The unit to align the maximum value, can be null .

Returns:FunctionData

The maximum value according to the specified unit or null if no maximum value is supported.

Exceptions
IllegalArgumentException:
If the unit is not supported.
getMetadataback to summary
public 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:String

The unit to align the metadata if it's applicable. It can be null, which means that the default unit will be used.

Returns:Map<String, ?>

The property metadata or null if no such metadata is available.

getMinValueback to summary
public 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:String

The unit to align the minimum value, can be null .

Returns:FunctionData

The minimum value according to the specified unit or null if no minimum value is supported.

Exceptions
IllegalArgumentException:
If the unit is not supported.
getStepback to summary
public 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:String

The unit to align the step, can be null.

Returns:FunctionData

The step according to the specified unit or null if no step is supported.

Exceptions
IllegalArgumentException:
If the unit is not supported.