Package org.osgi.service.dal.functions
Interface BooleanControl
-
- All Superinterfaces:
Function
public interface BooleanControl extends Function
BooleanControl
function provides a boolean control support. The eventable function state is accessible withgetData()
getter andsetData(boolean)
setter. The state can be reversed withinverse()
method, can be set totrue
value withsetTrue()
method and can be set tofalse
value withsetFalse()
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:
BooleanData
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OPERATION_INVERSE
Specifies the inverse operation name.static java.lang.String
OPERATION_SET_FALSE
Specifies the operation name, which sets the control state tofalse
value.static java.lang.String
OPERATION_SET_TRUE
Specifies the operation name, which sets the control state totrue
value.static java.lang.String
PROPERTY_DATA
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BooleanData
getData()
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 Detail
-
OPERATION_INVERSE
static final java.lang.String OPERATION_INVERSE
Specifies the inverse operation name. The operation can be executed withinverse()
method.- See Also:
- Constant Field Values
-
OPERATION_SET_TRUE
static final java.lang.String OPERATION_SET_TRUE
Specifies the operation name, which sets the control state totrue
value. The operation can be executed withsetTrue()
method.- See Also:
- Constant Field Values
-
OPERATION_SET_FALSE
static final java.lang.String OPERATION_SET_FALSE
Specifies the operation name, which sets the control state tofalse
value. The operation can be executed withsetFalse()
method.- See Also:
- Constant Field Values
-
PROPERTY_DATA
static final java.lang.String PROPERTY_DATA
Specifies the state property name. The eventable property value is accessible withgetData()
method.- See Also:
BooleanData
, Constant Field Values
-
-
Method Detail
-
getData
BooleanData getData() throws DeviceException
Returns the current state ofBooleanControl
. It's a getter method forPROPERTY_DATA
property.- Returns:
- The current state of
BooleanControl
. - Throws:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.- See Also:
BooleanData
,PROPERTY_DATA
-
setData
void setData(boolean data) throws DeviceException
Sets theBooleanControl
state to the specified value. It's setter method forPROPERTY_DATA
property.- Parameters:
data
- The new function value.- Throws:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.java.lang.IllegalArgumentException
- If there is an invalid argument.- See Also:
PROPERTY_DATA
-
inverse
void inverse() throws DeviceException
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:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.
-
setTrue
void setTrue() throws DeviceException
- Throws:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.
-
setFalse
void setFalse() throws DeviceException
- Throws:
java.lang.IllegalStateException
- If this function service object has already been unregistered.DeviceException
- If an operation error is available.
-
-