org.apache.felix.upnp.sample.binaryLight.statevariables
Class TargetStateVariable

java.lang.Object
  extended by org.apache.felix.upnp.sample.binaryLight.statevariables.TargetStateVariable
All Implemented Interfaces:
UPnPStateVariable

public class TargetStateVariable
extends Object
implements UPnPStateVariable


Field Summary
 
Fields inherited from interface org.osgi.service.upnp.UPnPStateVariable
TYPE_BIN_BASE64, TYPE_BIN_HEX, TYPE_BOOLEAN, TYPE_CHAR, TYPE_DATE, TYPE_DATETIME, TYPE_DATETIME_TZ, TYPE_FIXED_14_4, TYPE_FLOAT, TYPE_I1, TYPE_I2, TYPE_I4, TYPE_INT, TYPE_NUMBER, TYPE_R4, TYPE_R8, TYPE_STRING, TYPE_TIME, TYPE_TIME_TZ, TYPE_UI1, TYPE_UI2, TYPE_UI4, TYPE_URI, TYPE_UUID
 
Constructor Summary
TargetStateVariable()
           
 
Method Summary
 String[] getAllowedValues()
          Returns the allowed values, if defined.
 Object getDefaultValue()
          Returns the default value, if defined.
 Class getJavaDataType()
          Returns the Java class associated with the UPnP data type of this state variable.
 Number getMaximum()
          Returns the maximum value, if defined.
 Number getMinimum()
          Returns the minimum value, if defined.
 String getName()
          Returns the variable name.
 Number getStep()
          Returns the size of an increment operation, if defined.
 String getUPnPDataType()
          Returns the UPnP type of this state variable.
 boolean sendsEvents()
          Tells if this StateVariable can be used as an event source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetStateVariable

public TargetStateVariable()
Method Detail

getName

public String getName()
Description copied from interface: UPnPStateVariable
Returns the variable name.

Specified by:
getName in interface UPnPStateVariable
Returns:
Name of state variable. Must not contain a hyphen character nor a hash character. Should be < 32 characters.

getJavaDataType

public Class getJavaDataType()
Description copied from interface: UPnPStateVariable
Returns the Java class associated with the UPnP data type of this state variable.

Mapping between the UPnP data types and Java classes is performed according to the schema mentioned above.

 
  Integer              ui1, ui2, i1, i2, i4, int
  Long                 ui4, time, time.tz
  Float                r4, float
  Double               r8, number, fixed.14.4
  Character            char
  String               string, uri, uuid
  Date                 date, dateTime, dateTime.tz
  Boolean              boolean
  byte[]               bin.base64, bin.hex
  
 

Specified by:
getJavaDataType in interface UPnPStateVariable
Returns:
A class object corresponding to the Java type of this argument.

getUPnPDataType

public String getUPnPDataType()
Description copied from interface: UPnPStateVariable
Returns the UPnP type of this state variable. Valid types are defined as constants.

Specified by:
getUPnPDataType in interface UPnPStateVariable
Returns:
The UPnP data type of this state variable, as defined in above constants.

getDefaultValue

public Object getDefaultValue()
Description copied from interface: UPnPStateVariable
Returns the default value, if defined.

Specified by:
getDefaultValue in interface UPnPStateVariable
Returns:
The default value or null if not defined. The type of the returned object can be determined by getJavaDataType.

getAllowedValues

public String[] getAllowedValues()
Description copied from interface: UPnPStateVariable
Returns the allowed values, if defined. Allowed values can be defined only for String types.

Specified by:
getAllowedValues in interface UPnPStateVariable
Returns:
The allowed values or null if not defined. Should be less than 32 characters.

getMinimum

public Number getMinimum()
Description copied from interface: UPnPStateVariable
Returns the minimum value, if defined. Minimum values can only be defined for numeric types.

Specified by:
getMinimum in interface UPnPStateVariable
Returns:
The minimum value or null if not defined.

getMaximum

public Number getMaximum()
Description copied from interface: UPnPStateVariable
Returns the maximum value, if defined. Maximum values can only be defined for numeric types.

Specified by:
getMaximum in interface UPnPStateVariable
Returns:
The maximum value or null if not defined.

getStep

public Number getStep()
Description copied from interface: UPnPStateVariable
Returns the size of an increment operation, if defined. Step sizes can be defined only for numeric types.

Specified by:
getStep in interface UPnPStateVariable
Returns:
The increment size or null if not defined.

sendsEvents

public boolean sendsEvents()
Description copied from interface: UPnPStateVariable
Tells if this StateVariable can be used as an event source. If the StateVariable is eventable, an event listener service can be registered to be notified when changes to the variable appear.

Specified by:
sendsEvents in interface UPnPStateVariable
Returns:
true if the StateVariable generates events, false otherwise.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.