|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
V
- The Java type of the value handled by this datatype.public interface Datatype<V>
The type of a state variable value, able to convert to/from string representation.
Nested Class Summary | |
---|---|
static class |
Datatype.Builtin
Mapping from UPnP built-in standardized type to actual subtype of Datatype . |
static class |
Datatype.Default
Mapping from Java type to UPnP built-in type. |
Method Summary | |
---|---|
Datatype.Builtin |
getBuiltin()
|
String |
getDisplayString()
|
String |
getString(V value)
Transforms a value supported by this datatype into a string representation. |
boolean |
isHandlingJavaType(Class type)
|
boolean |
isValid(V value)
|
V |
valueOf(String s)
Transforms a string representation into a value of the supported type. |
Method Detail |
---|
boolean isHandlingJavaType(Class type)
true
if this datatype can handle values of the given Java type.Datatype.Builtin getBuiltin()
null
if this is a custom datatype.boolean isValid(V value)
value
- The value to validate or null
.
true
if the value was null
, validation result otherwise.String getString(V value) throws InvalidValueException
This method calls isValid(Object)
before converting the value, it throws
an exception if validation fails.
value
- The value to transform.
null
.
InvalidValueException
V valueOf(String s) throws InvalidValueException
s
- The string representation of a value.
null
if the string was null
or empty.
InvalidValueException
- If the string couldn't be parsed.String getDisplayString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |