public abstract class UpnpHeader<T> extends Object
The newInstance(org.fourthline.cling.model.message.header.UpnpHeader.Type, 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 |
UpnpHeader.Type
Maps a standardized UPnP header to potential header subtypes.
|
Constructor and Description |
---|
UpnpHeader() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getString() |
T |
getValue() |
static UpnpHeader |
newInstance(UpnpHeader.Type type,
String headerValue)
Create a new instance of a
UpnpHeader subtype that matches the given type and value. |
abstract void |
setString(String s) |
void |
setValue(T value) |
String |
toString() |
public void setValue(T value)
public T getValue()
public abstract void setString(String s) throws InvalidHeaderException
s
- This header's value as a string representation.InvalidHeaderException
- If the value is invalid for this UPnP header.public abstract String getString()
public static UpnpHeader newInstance(UpnpHeader.Type type, String headerValue)
UpnpHeader
subtype that matches the given type and value.
This method iterates through all potential header subtype classes as declared in UpnpHeader.Type
.
It creates a new instance of the subtype class and calls its setString(String)
method.
If no InvalidHeaderException
is thrown, the subtype
instance is returned.
type
- The type (or name) of the header.headerValue
- The value of the header.null
if no subtype can be found.Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.