Headers

sealed abstract class Headers

Headers represent an immutable append-only collection of Headers. To create a new Headers instance, you can use Headers#apply or Headers#empty and add an instance of Header using append.

Headers represent an immutable append-only collection of Headers. To create a new Headers instance, you can use Headers#apply or Headers#empty and add an instance of Header using append.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def append(header: Header): Headers

Creates a new Headers instance with the specified Header included.

Creates a new Headers instance with the specified Header included.

def append[V](key: String, value: V)(serializer: HeaderSerializer[V]): Headers

Creates a new Headers instance including a Header with the specified key and value.

Creates a new Headers instance including a Header with the specified key and value.

The Headers as an immutable Java Kafka Headers instance.

The Headers as an immutable Java Kafka Headers instance.

def concat(that: Headers): Headers

Appends the specified Headers after these headers.

Appends the specified Headers after these headers.

def exists(key: String): Boolean

Returns true if a header with the specified key exists; otherwise false.

Returns true if a header with the specified key exists; otherwise false.

def isEmpty: Boolean

true if no Headers are included; otherwise false.

true if no Headers are included; otherwise false.

def toChain: Chain[Header]

The included Headers as a Chain.

The included Headers as a Chain.

def withKey(key: String): Option[Header]

Returns the first header with the specified key, wrapped in Some, or None if no such header exists. The apply function is an alias.

Returns the first header with the specified key, wrapped in Some, or None if no such header exists. The apply function is an alias.

Concrete methods

final def apply(key: String): Option[Header]

Returns the first header with the specified key, wrapped in Some, or None if no such header exists. Alias for withKey.

Returns the first header with the specified key, wrapped in Some, or None if no such header exists. Alias for withKey.

final def nonEmpty: Boolean

true if at least one Header is included; otherwise false.

true if at least one Header is included; otherwise false.