public abstract class DLNAAttribute<T> extends Object
The newInstance(org.fourthline.cling.support.model.dlna.DLNAAttribute.Type, String, String)
method attempts to instantiate the best header subtype for a given header (name) and string value.
Modifier and Type | Class and Description |
---|---|
static class |
DLNAAttribute.Type
Maps a standardized DLNA attribute to potential attribute subtypes.
|
Constructor and Description |
---|
DLNAAttribute() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getString() |
T |
getValue() |
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. |
abstract void |
setString(String s,
String cf) |
void |
setValue(T value) |
String |
toString() |
public void setValue(T value)
public T getValue()
public abstract void setString(String s, String cf) throws InvalidDLNAProtocolAttributeException
s
- This attribute's value as a string representation.cf
- This attribute's mime type as a string representation, optional.InvalidDLNAProtocolAttributeException
- If the value is invalid for this DLNA attribute.public abstract String getString()
public static DLNAAttribute newInstance(DLNAAttribute.Type type, String attributeValue, String contentFormat)
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.
type
- The type of the attribute.attributeValue
- The value of the attribute.contentFormat
- The DLNA mime type of the attribute, optional.null
if no subtype can be found.Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.