Package org.jupnp.model.types
Schnittstelle Datatype<V>
- Typparameter:
V- The Java type of the value handled by this datatype.
- Alle bekannten Implementierungsklassen:
AbstractDatatype,Base64Datatype,BinHexDatatype,BooleanDatatype,CharacterDatatype,CustomDatatype,DateTimeDatatype,DoubleDatatype,FloatDatatype,IntegerDatatype,ShortDatatype,StringDatatype,UnsignedIntegerFourBytesDatatype,UnsignedIntegerOneByteDatatype,UnsignedIntegerTwoBytesDatatype,URIDatatype
public interface Datatype<V>
The type of a state variable value, able to convert to/from string representation.
- Autor:
- Christian Bauer
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypSchnittstelleBeschreibungstatic enumMapping from UPnP built-in standardized type to actual subtype ofDatatype.static enumMapping from Java type to UPnP built-in type. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungTransforms a value supported by this datatype into a string representation.booleanisHandlingJavaType(Class type) booleanTransforms a string representation into a value of the supported type.
-
Methodendetails
-
isHandlingJavaType
- Gibt zurück:
trueif this datatype can handle values of the given Java type.
-
getBuiltin
Datatype.Builtin getBuiltin()- Gibt zurück:
- The built-in UPnP standardized type this datatype is mapped to or
nullif this is a custom datatype.
-
isValid
- Parameter:
value- The value to validate ornull.- Gibt zurück:
- Returns
trueif the value wasnull, validation result otherwise.
-
getString
Transforms a value supported by this datatype into a string representation.This method calls
isValid(Object)before converting the value, it throws an exception if validation fails.- Parameter:
value- The value to transform.- Gibt zurück:
- The transformed value as a string, or an empty string when the value is null, never returns
null. - Löst aus:
InvalidValueException
-
valueOf
Transforms a string representation into a value of the supported type.- Parameter:
s- The string representation of a value.- Gibt zurück:
- The converted value or
nullif the string wasnullor empty. - Löst aus:
InvalidValueException- If the string couldn't be parsed.
-
getDisplayString
String getDisplayString()- Gibt zurück:
- Metadata about this datatype, a nice string for display that describes this datatype (e.g. concrete class name).
-