Package net.sbbi.upnp.services
Class ServiceStateVariable
- java.lang.Object
-
- net.sbbi.upnp.services.ServiceStateVariable
-
- All Implemented Interfaces:
ServiceStateVariableTypes
public class ServiceStateVariable extends Object implements ServiceStateVariableTypes
Class to contain a service state variable definition- Version:
- 1.0
- Author:
- SuperBonBon
-
-
Field Summary
Fields Modifier and Type Field Description protected Setallowedvaluesprotected StringdataTypeprotected StringdefaultValueprotected StringmaximumRangeValueprotected StringminimumRangeValueprotected Stringnameprotected UPNPServiceparentprotected booleansendEventsprotected StringstepRangeValue-
Fields inherited from interface net.sbbi.upnp.services.ServiceStateVariableTypes
BIN_BASE64, BIN_BASE64_INT, BIN_HEX, BIN_HEX_INT, BOOLEAN, BOOLEAN_INT, CHAR, CHAR_INT, DATE, DATE_INT, DATETIME, DATETIME_INT, DATETIME_TZ, DATETIME_TZ_INT, FIXED_14_4, FIXED_14_4_INT, FLOAT, FLOAT_INT, I1, I1_INT, I2, I2_INT, I4, I4_INT, INT, INT_INT, NUMBER, NUMBER_INT, R4, R4_INT, R8, R8_INT, STRING, STRING_INT, TIME, TIME_INT, TIME_TZ, TIME_TZ_INT, UI1, UI1_INT, UI2, UI2_INT, UI4, UI4_INT, URI, URI_INT, UUID, UUID_INT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceStateVariable()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SetgetAllowedvalues()A set of allowed values (String objects) for the variableStringgetDataType()The variable UPNP data typeClassgetDataTypeAsClass()The varialbe JAVA data type (using an UPNP-Java mapping)static ClassgetDataTypeClassMapping(String dataType)StringgetDefaultValue()The default value of the state variableStringgetMaximumRangeValue()The maximum value as a stringStringgetMinimumRangeValue()The minimum value as a stringStringgetName()State variable nameUPNPServicegetParent()The parent UPNPService ObjectStringgetStepRangeValue()The value step range as a stringstatic StringgetUPNPDataTypeMapping(String className)StringgetValue()Call to the UPNP device to retreive the state variable actual valuebooleanisSendEvents()Boolean to indicate if the variable is sending events when value of the var is changing.static ObjectUPNPToJavaObject(String dataType, String value)
-
-
-
Field Detail
-
name
protected String name
-
sendEvents
protected boolean sendEvents
-
dataType
protected String dataType
-
defaultValue
protected String defaultValue
-
minimumRangeValue
protected String minimumRangeValue
-
maximumRangeValue
protected String maximumRangeValue
-
stepRangeValue
protected String stepRangeValue
-
allowedvalues
protected Set allowedvalues
-
parent
protected UPNPService parent
-
-
Method Detail
-
getValue
public String getValue() throws UPNPResponseException, IOException
Call to the UPNP device to retreive the state variable actual value- Returns:
- the state variable actual value on the device, should be never null, an empty string could be returned by the device
- Throws:
UPNPResponseException- if the device throws an exception during queryIOException- if some IO error with device occurs during query
-
getName
public String getName()
State variable name- Returns:
- the state variable name
-
getParent
public UPNPService getParent()
The parent UPNPService Object- Returns:
- the parent object instance
-
isSendEvents
public boolean isSendEvents()
Boolean to indicate if the variable is sending events when value of the var is changing. The events can be subscribed via theServicesEventingclass- Returns:
- true if sending events
-
getDefaultValue
public String getDefaultValue()
The default value of the state variable- Returns:
- the default value representation as an string
-
getDataType
public String getDataType()
The variable UPNP data type- Returns:
- the data type
-
getDataTypeAsClass
public Class getDataTypeAsClass()
The varialbe JAVA data type (using an UPNP-Java mapping)- Returns:
- the class mapped
-
getAllowedvalues
public Set getAllowedvalues()
A set of allowed values (String objects) for the variable- Returns:
- the allowed values or null if none
-
getMinimumRangeValue
public String getMinimumRangeValue()
The minimum value as a string- Returns:
- the minimum value or null if no restriction
-
getMaximumRangeValue
public String getMaximumRangeValue()
The maximum value as a string- Returns:
- the maximum value or null if no restriction
-
getStepRangeValue
public String getStepRangeValue()
The value step range as a string- Returns:
- the value step raqnge or null if no restriction
-
-