public abstract class ModeledCustomHeaderFactory<H extends ModeledCustomHeader>
extends java.lang.Object
ModeledCustomHeader
class. It offers methods to create ModeledCustomHeader
from String
or HttpHeader
.Constructor and Description |
---|
ModeledCustomHeaderFactory() |
Modifier and Type | Method and Description |
---|---|
H |
create(java.lang.String value)
Creates a new
ModeledCustomHeader from the value checking that the format is correct. |
java.util.Optional<H> |
from(HttpHeader header)
Transforms an
HttpHeader to this ModeledCustomHeader if the name and value are
correct. |
java.lang.String |
lowercaseName() |
abstract java.lang.String |
name() |
protected abstract H |
parse(java.lang.String value)
Parses the value checking that the format is correct.
|
public abstract java.lang.String name()
public java.lang.String lowercaseName()
protected abstract H parse(java.lang.String value)
public H create(java.lang.String value)
ModeledCustomHeader
from the value checking that the format is correct.
It may throw if value is not correctpublic java.util.Optional<H> from(HttpHeader header)
HttpHeader
to this ModeledCustomHeader
if the name and value are
correct. It may throw in case of malformed headers