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.LIGHT
Types.DOOR
Types.WINDOW
Types.POWER
- other type defined in
Types
- custom - vendor specific type
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Specifies the inverse operation name.static final String
Specifies the operation name, which sets the control state tofalse
value.static final String
Specifies the operation name, which sets the control state totrue
value.static final String
Specifies 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
.void
inverse()
Reverses theBooleanControl
state.void
setData
(boolean data) Sets theBooleanControl
state to the specified value.void
setFalse()
Sets theBooleanControl
state tofalse
value.void
setTrue()
Sets theBooleanControl
state totrue
value.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 totrue
value. The operation can be executed withsetTrue()
method.- See Also:
-
OPERATION_SET_FALSE
Specifies the operation name, which sets the control state tofalse
value. 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_DATA
property.- 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 theBooleanControl
state to the specified value. It's setter method forPROPERTY_DATA
property.- 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 theBooleanControl
state. If the current state representstrue
value, it'll be changed tofalse
. If the current state representsfalse
value, 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.
-