Package org.apache.kafka.connect.header
Class ConnectHeaders
- java.lang.Object
- 
- org.apache.kafka.connect.header.ConnectHeaders
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.kafka.connect.header.HeadersHeaders.HeaderTransform
 
- 
 - 
Constructor SummaryConstructors Constructor Description ConnectHeaders()ConnectHeaders(Iterable<Header> original)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Headersadd(String key, Object value, Schema schema)Add to this collection aHeaderwith the given key and value.Headersadd(String key, SchemaAndValue schemaAndValue)Add to this collection aHeaderwith the given key and value.Headersadd(Header header)Add the givenHeaderto this collection.HeadersaddBoolean(String key, boolean value)Add to this collection aHeaderwith the given key and value.HeadersaddByte(String key, byte value)Add to this collection aHeaderwith the given key and value.HeadersaddBytes(String key, byte[] value)Add to this collection aHeaderwith the given key and value.HeadersaddDate(String key, Date value)HeadersaddDecimal(String key, BigDecimal value)HeadersaddDouble(String key, double value)Add to this collection aHeaderwith the given key and value.HeadersaddFloat(String key, float value)Add to this collection aHeaderwith the given key and value.HeadersaddInt(String key, int value)Add to this collection aHeaderwith the given key and value.HeadersaddList(String key, List<?> value, Schema schema)Add to this collection aHeaderwith the given key and value.HeadersaddLong(String key, long value)Add to this collection aHeaderwith the given key and value.HeadersaddMap(String key, Map<?,?> value, Schema schema)Add to this collection aHeaderwith the given key and value.HeadersaddShort(String key, short value)Add to this collection aHeaderwith the given key and value.HeadersaddString(String key, String value)Add to this collection aHeaderwith the given key and value.HeadersaddStruct(String key, Struct value)Add to this collection aHeaderwith the given key and value.HeadersaddTime(String key, Date value)HeadersaddTimestamp(String key, Date value)protected HeadersaddWithoutValidating(String key, Object value, Schema schema)Iterator<Header>allWithName(String key)Headersapply(String key, Headers.HeaderTransform transform)Get allHeaders with the given key, apply the transform to each and store the result in place of the original.Headersapply(Headers.HeaderTransform transform)Get allHeaders, apply the transform to each and store the result in place of the original.Headersclear()Removes all headers from this object.ConnectHeadersduplicate()Create a copy of thisHeadersobject.booleanequals(Object obj)inthashCode()booleanisEmpty()Determine whether this object has no headers.Iterator<Header>iterator()HeaderlastWithName(String key)Return the lastHeaderwith the specified key.Headersremove(String key)HeadersretainLatest()Removes all but the lastHeaderobject with each key.HeadersretainLatest(String key)intsize()Get the number of headers in this object.StringtoString()- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Method Detail- 
sizepublic int size() Description copied from interface:HeadersGet the number of headers in this object.
 - 
isEmptypublic boolean isEmpty() Description copied from interface:HeadersDetermine whether this object has no headers.
 - 
clearpublic Headers clear() Description copied from interface:HeadersRemoves all headers from this object.
 - 
addpublic Headers add(Header header) Description copied from interface:HeadersAdd the givenHeaderto this collection.
 - 
addWithoutValidatingprotected Headers addWithoutValidating(String key, Object value, Schema schema) 
 - 
addpublic Headers add(String key, SchemaAndValue schemaAndValue) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.- Specified by:
- addin interface- Headers
- Parameters:
- key- the header's key; may not be null
- schemaAndValue- the- SchemaAndValuefor the header; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
addpublic Headers add(String key, Object value, Schema schema) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addStringpublic Headers addString(String key, String value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addBytespublic Headers addBytes(String key, byte[] value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addBooleanpublic Headers addBoolean(String key, boolean value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.- Specified by:
- addBooleanin interface- Headers
- Parameters:
- key- the header's key; may not be null
- value- the header's value; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
addBytepublic Headers addByte(String key, byte value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addShortpublic Headers addShort(String key, short value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addIntpublic Headers addInt(String key, int value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addLongpublic Headers addLong(String key, long value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addFloatpublic Headers addFloat(String key, float value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addDoublepublic Headers addDouble(String key, double value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addListpublic Headers addList(String key, List<?> value, Schema schema) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addMappublic Headers addMap(String key, Map<?,?> value, Schema schema) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addStructpublic Headers addStruct(String key, Struct value) Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.
 - 
addDecimalpublic Headers addDecimal(String key, BigDecimal value) Description copied from interface:Headers- Specified by:
- addDecimalin interface- Headers
- Parameters:
- key- the header's key; may not be null
- value- the header's- Decimalvalue; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
addTimestamppublic Headers addTimestamp(String key, Date value) Description copied from interface:Headers- Specified by:
- addTimestampin interface- Headers
- Parameters:
- key- the header's key; may not be null
- value- the header's- Timestampvalue; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
lastWithNamepublic Header lastWithName(String key) Description copied from interface:HeadersReturn the lastHeaderwith the specified key.- Specified by:
- lastWithNamein interface- Headers
- Parameters:
- key- the key for the header; may not be null
- Returns:
- the last Header, or null if there are no headers with the specified key
 
 - 
allWithNamepublic Iterator<Header> allWithName(String key) Description copied from interface:Headers- Specified by:
- allWithNamein interface- Headers
- Parameters:
- key- the key; may not be null
- Returns:
- the iterator over headers with the specified key; may be null if there are no headers with the specified key
 
 - 
retainLatestpublic Headers retainLatest() Description copied from interface:HeadersRemoves all but the lastHeaderobject with each key.- Specified by:
- retainLatestin interface- Headers
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
retainLatestpublic Headers retainLatest(String key) Description copied from interface:Headers- Specified by:
- retainLatestin interface- Headers
- Parameters:
- key- the key; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
 - 
applypublic Headers apply(String key, Headers.HeaderTransform transform) Description copied from interface:HeadersGet allHeaders with the given key, apply the transform to each and store the result in place of the original.
 - 
applypublic Headers apply(Headers.HeaderTransform transform) Description copied from interface:HeadersGet allHeaders, apply the transform to each and store the result in place of the original.
 
- 
 
-