java.lang.Iterable<Header>
ConnectHeaders
public interface Headers extends java.lang.Iterable<Header>
Modifier and Type | Interface | Description |
---|---|---|
static interface |
Headers.HeaderTransform |
A function to transform the supplied
Header . |
Modifier and Type | Method | Description |
---|---|---|
Headers |
add(java.lang.String key,
java.lang.Object value,
Schema schema) |
Add to this collection a
Header with the given key and value. |
Headers |
add(java.lang.String key,
SchemaAndValue schemaAndValue) |
Add to this collection a
Header with the given key and value. |
Headers |
add(Header header) |
Add the given
Header to this collection. |
Headers |
addBoolean(java.lang.String key,
boolean value) |
Add to this collection a
Header with the given key and value. |
Headers |
addByte(java.lang.String key,
byte value) |
Add to this collection a
Header with the given key and value. |
Headers |
addBytes(java.lang.String key,
byte[] value) |
Add to this collection a
Header with the given key and value. |
Headers |
addDate(java.lang.String key,
java.util.Date value) |
|
Headers |
addDecimal(java.lang.String key,
java.math.BigDecimal value) |
|
Headers |
addDouble(java.lang.String key,
double value) |
Add to this collection a
Header with the given key and value. |
Headers |
addFloat(java.lang.String key,
float value) |
Add to this collection a
Header with the given key and value. |
Headers |
addInt(java.lang.String key,
int value) |
Add to this collection a
Header with the given key and value. |
Headers |
addList(java.lang.String key,
java.util.List<?> value,
Schema schema) |
Add to this collection a
Header with the given key and value. |
Headers |
addLong(java.lang.String key,
long value) |
Add to this collection a
Header with the given key and value. |
Headers |
addMap(java.lang.String key,
java.util.Map<?,?> value,
Schema schema) |
Add to this collection a
Header with the given key and value. |
Headers |
addShort(java.lang.String key,
short value) |
Add to this collection a
Header with the given key and value. |
Headers |
addString(java.lang.String key,
java.lang.String value) |
Add to this collection a
Header with the given key and value. |
Headers |
addStruct(java.lang.String key,
Struct value) |
Add to this collection a
Header with the given key and value. |
Headers |
addTime(java.lang.String key,
java.util.Date value) |
|
Headers |
addTimestamp(java.lang.String key,
java.util.Date value) |
|
java.util.Iterator<Header> |
allWithName(java.lang.String key) |
|
Headers |
apply(java.lang.String key,
Headers.HeaderTransform transform) |
Get all
Header s with the given key, apply the transform to each and store the result in place of the original. |
Headers |
apply(Headers.HeaderTransform transform) |
Get all
Header s, apply the transform to each and store the result in place of the original. |
Headers |
clear() |
Removes all headers from this object.
|
Headers |
duplicate() |
Create a copy of this
Headers object. |
boolean |
isEmpty() |
Determine whether this object has no headers.
|
Header |
lastWithName(java.lang.String key) |
Return the last
Header with the specified key. |
Headers |
remove(java.lang.String key) |
|
Headers |
retainLatest() |
Removes all but the last object with each key.
|
Headers |
retainLatest(java.lang.String key) |
|
int |
size() |
Get the number of headers in this object.
|
int size()
boolean isEmpty()
java.util.Iterator<Header> allWithName(java.lang.String key)
key
- the key; may not be nullHeader lastWithName(java.lang.String key)
Header
with the specified key.key
- the key for the header; may not be nullHeaders add(Header header)
Header
to this collection.header
- the header; may not be nullHeaders add(java.lang.String key, SchemaAndValue schemaAndValue)
Header
with the given key and value.key
- the header's key; may not be nullschemaAndValue
- the SchemaAndValue
for the header; may be nullHeaders add(java.lang.String key, java.lang.Object value, Schema schema)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullschema
- the schema for the header's value; may not be null if the value is not nullHeaders addString(java.lang.String key, java.lang.String value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addBoolean(java.lang.String key, boolean value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addByte(java.lang.String key, byte value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addShort(java.lang.String key, short value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addInt(java.lang.String key, int value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addLong(java.lang.String key, long value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addFloat(java.lang.String key, float value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addDouble(java.lang.String key, double value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addBytes(java.lang.String key, byte[] value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullHeaders addList(java.lang.String key, java.util.List<?> value, Schema schema)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullschema
- the schema describing the list value; may not be nullDataException
- if the header's value is invalidHeaders addMap(java.lang.String key, java.util.Map<?,?> value, Schema schema)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullschema
- the schema describing the map value; may not be nullDataException
- if the header's value is invalidHeaders addStruct(java.lang.String key, Struct value)
Header
with the given key and value.key
- the header's key; may not be nullvalue
- the header's value; may be nullDataException
- if the header's value is invalidHeaders addDecimal(java.lang.String key, java.math.BigDecimal value)
key
- the header's key; may not be nullvalue
- the header's Decimal
value; may be nullHeaders addDate(java.lang.String key, java.util.Date value)
key
- the header's key; may not be nullvalue
- the header's Date
value; may be nullHeaders addTime(java.lang.String key, java.util.Date value)
key
- the header's key; may not be nullvalue
- the header's Time
value; may be nullHeaders addTimestamp(java.lang.String key, java.util.Date value)
key
- the header's key; may not be nullvalue
- the header's Timestamp
value; may be nullHeaders remove(java.lang.String key)
key
- the key; may not be nullHeaders retainLatest(java.lang.String key)
key
- the key; may not be nullHeaders retainLatest()
Headers clear()
Headers duplicate()
Headers
object. The new copy will contain all of the same Header
objects as this object.Headers apply(Headers.HeaderTransform transform)
Header
s, apply the transform to each and store the result in place of the original.transform
- the transform to apply; may not be nullDataException
- if the header's value is invalidHeaders apply(java.lang.String key, Headers.HeaderTransform transform)
Header
s with the given key, apply the transform to each and store the result in place of the original.key
- the header's key; may not be nulltransform
- the transform to apply; may not be nullDataException
- if the header's value is invalid