Package org.apache.kafka.connect.header
Interface Headers
- All Known Implementing Classes:
- ConnectHeaders
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA function to transform the suppliedHeader.
- 
Method SummaryModifier and TypeMethodDescriptionAdd to this collection aHeaderwith the given key and value.add(String key, SchemaAndValue schemaAndValue) Add to this collection aHeaderwith the given key and value.Add the givenHeaderto this collection.addBoolean(String key, boolean value) Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.addDecimal(String key, BigDecimal value) Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.Add to this collection aHeaderwith the given key and value.addTimestamp(String key, Date value) allWithName(String key) apply(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.apply(Headers.HeaderTransform transform) Get allHeaders, apply the transform to each and store the result in place of the original.clear()Removes all headers from this object.Create a copy of thisHeadersobject.booleanisEmpty()Determine whether this object has no headers.lastWithName(String key) Return the lastHeaderwith the specified key.Removes all but the lastHeaderobject with each key.retainLatest(String key) intsize()Get the number of headers in this object.Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
- 
Method Details- 
sizeint size()Get the number of headers in this object.- Returns:
- the number of headers; never negative
 
- 
isEmptyboolean isEmpty()Determine whether this object has no headers.- Returns:
- true if there are no headers, or false if there is at least one header
 
- 
allWithName- 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
 
- 
lastWithNameReturn the lastHeaderwith the specified key.- 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
 
- 
addAdd the givenHeaderto this collection.- Parameters:
- header- the header; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
addAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addAdd to this collection aHeaderwith the given key and value.- Parameters:
- key- the header's key; may not be null
- value- the header's value; may be null
- schema- the schema for the header's value; may not be null if the value is not null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
addStringAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addBooleanAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addByteAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addShortAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addIntAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addLongAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addFloatAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addDoubleAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addBytesAdd to this collection aHeaderwith the given key and value.- 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
 
- 
addListAdd to this collection aHeaderwith the given key and value.- Parameters:
- key- the header's key; may not be null
- value- the header's value; may be null
- schema- the schema describing the list value; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
- Throws:
- DataException- if the header's value is invalid
 
- 
addMapAdd to this collection aHeaderwith the given key and value.- Parameters:
- key- the header's key; may not be null
- value- the header's value; may be null
- schema- the schema describing the map value; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
- Throws:
- DataException- if the header's value is invalid
 
- 
addStructAdd to this collection aHeaderwith the given key and value.- 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
- Throws:
- DataException- if the header's value is invalid
 
- 
addDecimal- 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
 
- 
addDate- Parameters:
- key- the header's key; may not be null
- value- the header's- Datevalue; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
addTime- Parameters:
- key- the header's key; may not be null
- value- the header's- Timevalue; may be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
addTimestamp- 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
 
- 
remove- Parameters:
- key- the key; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
retainLatest- Parameters:
- key- the key; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
retainLatestHeaders retainLatest()Removes all but the lastHeaderobject with each key.- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
clearHeaders clear()Removes all headers from this object.- Returns:
- this object to facilitate chaining multiple methods; never null
 
- 
duplicateHeaders duplicate()Create a copy of thisHeadersobject. The new copy will contain all of the sameHeaderobjects as this object.- Returns:
- the copy; never null
 
- 
applyGet allHeaders, apply the transform to each and store the result in place of the original.- Parameters:
- transform- the transform to apply; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
- Throws:
- DataException- if the header's value is invalid
 
- 
applyGet allHeaders with the given key, apply the transform to each and store the result in place of the original.- Parameters:
- key- the header's key; may not be null
- transform- the transform to apply; may not be null
- Returns:
- this object to facilitate chaining multiple methods; never null
- Throws:
- DataException- if the header's value is invalid
 
 
-