public interface BooleanControl extends 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
Types
BooleanData
Modifier and Type | Field and Description |
---|---|
static String |
OPERATION_INVERSE
Specifies the inverse operation name.
|
static String |
OPERATION_SET_FALSE
Specifies the operation name, which sets the control state to
false value. |
static String |
OPERATION_SET_TRUE
Specifies the operation name, which sets the control state to
true value. |
static String |
PROPERTY_DATA
Specifies the state property name.
|
SERVICE_DESCRIPTION, SERVICE_DEVICE_UID, SERVICE_OPERATION_NAMES, SERVICE_PROPERTY_NAMES, SERVICE_REFERENCE_UIDS, SERVICE_TYPE, SERVICE_UID, SERVICE_VERSION
Modifier and Type | Method and Description |
---|---|
BooleanData |
getData()
Returns the current state of
BooleanControl . |
void |
inverse()
Reverses the
BooleanControl state. |
void |
setData(boolean data)
Sets the
BooleanControl state to the specified value. |
void |
setFalse()
Sets the
BooleanControl state to false value. |
void |
setTrue()
Sets the
BooleanControl state to true value. |
getOperationMetadata, getPropertyMetadata, getServiceProperty, getServicePropertyKeys
static final String OPERATION_INVERSE
inverse()
method.static final String OPERATION_SET_TRUE
true
value. The operation can be executed with setTrue()
method.static final String OPERATION_SET_FALSE
false
value. The operation can be executed with
setFalse()
method.static final String PROPERTY_DATA
getData()
method.BooleanData
,
Constant Field ValuesBooleanData getData() throws DeviceException
BooleanControl
. It's a getter method
for PROPERTY_DATA
property.BooleanControl
.IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.BooleanData
,
PROPERTY_DATA
void setData(boolean data) throws DeviceException
BooleanControl
state to the specified value. It's setter
method for PROPERTY_DATA
property.data
- The new function value.IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.IllegalArgumentException
- If there is an invalid argument.PROPERTY_DATA
void inverse() throws DeviceException
BooleanControl
state. If the current state
represents true
value, it'll be changed to false
. If the
current state represents false
value, it'll be changed to
true
. The operation name is OPERATION_INVERSE
.IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.void setTrue() throws DeviceException
IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.void setFalse() throws DeviceException
IllegalStateException
- If this function service object has already
been unregistered.DeviceException
- If an operation error is available.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0