Package org.osgi.service.dal.functions
Interface BooleanControl
- All Superinterfaces:
Function
BooleanControl function provides a boolean control support. The
eventable function state is accessible with getData() getter and
setData(boolean) setter. The state can be reversed with
inverse() method, can be set to true value with
setTrue() method and can be set to false value with
setFalse() method.
The control type can be:
Types.LIGHTTypes.DOORTypes.WINDOWTypes.POWER- other type defined in
Types - custom - vendor specific type
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSpecifies the inverse operation name.static final StringSpecifies the operation name, which sets the control state tofalsevalue.static final StringSpecifies the operation name, which sets the control state totruevalue.static final StringSpecifies the state property name.Fields inherited from interface org.osgi.service.dal.Function
SERVICE_DESCRIPTION, SERVICE_DEVICE_UID, SERVICE_OPERATION_NAMES, SERVICE_PROPERTY_NAMES, SERVICE_REFERENCE_UIDS, SERVICE_TYPE, SERVICE_UID, SERVICE_VERSION -
Method Summary
Modifier and TypeMethodDescriptiongetData()Returns the current state ofBooleanControl.voidinverse()Reverses theBooleanControlstate.voidsetData(boolean data) Sets theBooleanControlstate to the specified value.voidsetFalse()Sets theBooleanControlstate tofalsevalue.voidsetTrue()Sets theBooleanControlstate totruevalue.Methods inherited from interface org.osgi.service.dal.Function
getOperationMetadata, getPropertyMetadata, getServiceProperty, getServicePropertyKeys
-
Field Details
-
OPERATION_INVERSE
Specifies the inverse operation name. The operation can be executed withinverse()method.- See Also:
-
OPERATION_SET_TRUE
Specifies the operation name, which sets the control state totruevalue. The operation can be executed withsetTrue()method.- See Also:
-
OPERATION_SET_FALSE
Specifies the operation name, which sets the control state tofalsevalue. The operation can be executed withsetFalse()method.- See Also:
-
PROPERTY_DATA
Specifies the state property name. The eventable property value is accessible withgetData()method.- See Also:
-
-
Method Details
-
getData
Returns the current state ofBooleanControl. It's a getter method forPROPERTY_DATAproperty.- Returns:
- The current state of
BooleanControl. - Throws:
IllegalStateException- If this function service object has already been unregistered.DeviceException- If an operation error is available.- See Also:
-
setData
Sets theBooleanControlstate to the specified value. It's setter method forPROPERTY_DATAproperty.- Parameters:
data- The new function value.- Throws:
IllegalStateException- If this function service object has already been unregistered.DeviceException- If an operation error is available.IllegalArgumentException- If there is an invalid argument.- See Also:
-
inverse
Reverses theBooleanControlstate. If the current state representstruevalue, it'll be changed tofalse. If the current state representsfalsevalue, it'll be changed totrue. The operation name isOPERATION_INVERSE.- Throws:
IllegalStateException- If this function service object has already been unregistered.DeviceException- If an operation error is available.
-
setTrue
- Throws:
IllegalStateException- If this function service object has already been unregistered.DeviceException- If an operation error is available.
-
setFalse
- Throws:
IllegalStateException- If this function service object has already been unregistered.DeviceException- If an operation error is available.
-