Interface HeaderField
public interface HeaderField
Represents a single header field, consisting of a
Key and a
value.
Use of(String) or of(String, String) to create an instance
of a basic
HeaderField which implements Object.hashCode() and
Object.equals(Object).
- Author:
- Martin Siegemund
-
Method Summary
Modifier and Type Method Description Stringkey()Retrieve the header fields key.static HeaderFieldof(String key)Creates a new instance of aHeaderFieldwith an empty (null) value.static HeaderFieldof(String key, String value)Creates a new instance of aHeaderField.Optional<String>value()Retrieve the header fields value.
-
Method Details
-
key
String key()Retrieve the header fields key.- Returns:
- the key
-
value
Retrieve the header fields value. The value may be empty.- Returns:
- the value or
Optional.empty()
-
of
Creates a new instance of aHeaderField.- Parameters:
key- the fields keyvalue- the fields value (may benull)- Returns:
- the new instance
-
of
Creates a new instance of aHeaderFieldwith an empty (null) value.- Parameters:
key- the fields key- Returns:
- the new instance
-