Klasse AbstractDatatype<V>

java.lang.Object
org.jupnp.model.types.AbstractDatatype<V>
Alle implementierten Schnittstellen:
Datatype<V>
Bekannte direkte Unterklassen:
Base64Datatype, BinHexDatatype, BooleanDatatype, CharacterDatatype, CustomDatatype, DateTimeDatatype, DoubleDatatype, FloatDatatype, IntegerDatatype, ShortDatatype, StringDatatype, UnsignedIntegerFourBytesDatatype, UnsignedIntegerOneByteDatatype, UnsignedIntegerTwoBytesDatatype, URIDatatype

public abstract class AbstractDatatype<V> extends Object implements Datatype<V>
Autor:
Christian Bauer
  • Konstruktordetails

    • AbstractDatatype

      public AbstractDatatype()
  • Methodendetails

    • getValueType

      protected Class<V> getValueType()
    • isHandlingJavaType

      public boolean isHandlingJavaType(Class type)
      Angegeben von:
      isHandlingJavaType in Schnittstelle Datatype<V>
      Gibt zurück:
      true if this datatype can handle values of the given Java type.
    • valueOf

      public V valueOf(String s) throws InvalidValueException
      Beschreibung aus Schnittstelle kopiert: Datatype
      Transforms a string representation into a value of the supported type.
      Angegeben von:
      valueOf in Schnittstelle Datatype<V>
      Parameter:
      s - The string representation of a value.
      Gibt zurück:
      The converted value or null if the string was null or empty.
      Löst aus:
      InvalidValueException - If the string couldn't be parsed.
    • getBuiltin

      public Datatype.Builtin getBuiltin()
      Angegeben von:
      getBuiltin in Schnittstelle Datatype<V>
      Gibt zurück:
      The built-in UPnP standardized type this datatype is mapped to or null if this is a custom datatype.
    • setBuiltin

      public void setBuiltin(Datatype.Builtin builtin)
    • getString

      public String getString(V value) throws InvalidValueException
      Beschreibung aus Schnittstelle kopiert: Datatype
      Transforms a value supported by this datatype into a string representation.

      This method calls Datatype.isValid(Object) before converting the value, it throws an exception if validation fails.

      Angegeben von:
      getString in Schnittstelle Datatype<V>
      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
    • isValid

      public boolean isValid(V value)
      Angegeben von:
      isValid in Schnittstelle Datatype<V>
      Parameter:
      value - The value to validate or null.
      Gibt zurück:
      Returns true if the value was null, validation result otherwise.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • getDisplayString

      public String getDisplayString()
      Angegeben von:
      getDisplayString in Schnittstelle Datatype<V>
      Gibt zurück:
      Metadata about this datatype, a nice string for display that describes this datatype (e.g. concrete class name).