Package org.dmfs.httpessentials.headers
Interface HeaderType<ValueType>
- Type Parameters:
ValueType- The type of the header value.
- All Superinterfaces:
EntityType<ValueType>
- All Known Subinterfaces:
ListHeaderType<ValueType>,SingletonHeaderType<ValueType>
Represents a header type. That is, it binds a header name to a value type.
Two HeaderTypes are considered equal if they have the same header name.
-
Method Summary
Modifier and TypeMethodDescriptionFactory method to createHeaders of this type from a value.entityFromString(String headerValueString) name()Returns the name of the header.valueString(ValueType headerValue) Returns the string representation of the given value as defined for thisHeaderType.Methods inherited from interface org.dmfs.httpessentials.typedentity.EntityType
valueFromString
-
Method Details
-
name
String name()Returns the name of the header.- Specified by:
namein interfaceEntityType<ValueType>- Returns:
- The header name, never
null.
-
entityFromString
- Specified by:
entityFromStringin interfaceEntityType<ValueType>- Parameters:
headerValueString- The String representation of the Header as transferred over the wire.- Returns:
- A new
Headerinstance.
-
entity
Factory method to createHeaders of this type from a value.- Specified by:
entityin interfaceEntityType<ValueType>- Parameters:
value- The value of the header, must not benull- Returns:
- A new
Headerinstance.
-
valueString
Returns the string representation of the given value as defined for thisHeaderType.- Specified by:
valueStringin interfaceEntityType<ValueType>- Parameters:
headerValue- The value to convert.- Returns:
- A header value String representing the given value.
-