Package org.osgi.service.dal.functions
Interface BooleanControl
-
- All Superinterfaces:
Function
public interface BooleanControl extends Function
BooleanControlfunction 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 totruevalue withsetTrue()method and can be set tofalsevalue withsetFalse()method.The control type can be:
Types.LIGHTTypes.DOORTypes.WINDOWTypes.POWER- other type defined in
Types - custom - vendor specific type
- See Also:
BooleanData
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOPERATION_INVERSESpecifies the inverse operation name.static java.lang.StringOPERATION_SET_FALSESpecifies the operation name, which sets the control state tofalsevalue.static java.lang.StringOPERATION_SET_TRUESpecifies the operation name, which sets the control state totruevalue.static java.lang.StringPROPERTY_DATASpecifies 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 BooleanDatagetData()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 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 totruevalue. 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 tofalsevalue. 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_DATAproperty.- 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 DeviceExceptionSets theBooleanControlstate to the specified value. It's setter method forPROPERTY_DATAproperty.- 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 DeviceExceptionReverses 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:
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.
-
-