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 Details

    • key

      String key()
      Retrieve the header fields key.
      Returns:
      the key
    • value

      Optional<String> value()
      Retrieve the header fields value. The value may be empty.
      Returns:
      the value or Optional.empty()
    • of

      static HeaderField of​(String key, String value)
      Creates a new instance of a HeaderField.
      Parameters:
      key - the fields key
      value - the fields value (may be null)
      Returns:
      the new instance
    • of

      static HeaderField of​(String key)
      Creates a new instance of a HeaderField with an empty (null) value.
      Parameters:
      key - the fields key
      Returns:
      the new instance