Klasse DLNAAttribute<T>

java.lang.Object
org.jupnp.support.model.dlna.DLNAAttribute<T>
Bekannte direkte Unterklassen:
DLNAConversionIndicatorAttribute, DLNAFlagsAttribute, DLNAOperationsAttribute, DLNAPlaySpeedAttribute, DLNAProfileAttribute

public abstract class DLNAAttribute<T> extends Object
Transforms known and standardized DLNA attributes from/to string representation.

The newInstance(org.jupnp.support.model.dlna.DLNAAttribute.Type, String, String) method attempts to instantiate the best header subtype for a given header (name) and string value.

Autor:
Christian Bauer, Mario Franco, Amit Kumar Mondal - Code Refactoring
  • Konstruktordetails

    • DLNAAttribute

      public DLNAAttribute()
  • Methodendetails

    • setValue

      public void setValue(T value)
    • getValue

      public T getValue()
    • setString

      public abstract void setString(String s, String cf)
      Parameter:
      s - This attribute's value as a string representation.
      cf - This attribute's mime type as a string representation, optional.
      Löst aus:
      InvalidDLNAProtocolAttributeException - If the value is invalid for this DLNA attribute.
    • getString

      public abstract String getString()
      Gibt zurück:
      A string representing this attribute's value.
    • newInstance

      public static DLNAAttribute<?> newInstance(DLNAAttribute.Type type, String attributeValue, String contentFormat)
      Create a new instance of a DLNAAttribute subtype that matches the given type and value.

      This method iterates through all potential attribute subtype classes as declared in DLNAAttribute.Type. It creates a new instance of the subtype class and calls its setString(String, String) method. If no InvalidDLNAProtocolAttributeException is thrown, the subtype instance is returned.

      Parameter:
      type - The type of the attribute.
      attributeValue - The value of the attribute.
      contentFormat - The DLNA mime type of the attribute, optional.
      Gibt zurück:
      The best matching attribute subtype instance, or null if no subtype can be found.
    • toString

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