Interface Headers

All Superinterfaces:
Map<String, List<String>>

public sealed interface Headers extends Map<String, List<String>>

Represents the headers of a STOMP frame.

Headers are key-value pairs that provide metadata about the STOMP frame. Each key can have multiple values. The first value for a given key can be retrieved using the getFirst(String) method. The first value is also the true value. Subsequent values are provided to give a history of changes to that value over eventual multiple hops.

Implementations may not be thread-safe.

Since:
1.0.0
  • Method Details

    • addFirst

      void addFirst(String key, String value)
      Adds a header with the specified key and value. If the key already exists, the new value is added as the first value for that key Meaning it takes precedence over existing values.
      Parameters:
      key - the header key
      value - the header value
      Since:
      1.0.0
    • getFirst

      @Nullable String getFirst(String key)
      Returns the first value associated with the specified key. If the key does not exist, returns null.
      Parameters:
      key - the header key
      Returns:
      the first header value, or null if the key does not exist
      Since:
      1.0.0