Package org.apache.kafka.connect.header
Class ConnectHeaders
java.lang.Object
org.apache.kafka.connect.header.ConnectHeaders
A basic
Headers implementation.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.connect.header.Headers
Headers.HeaderTransform -
Constructor Summary
Constructors -
Method Summary
Modifier 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.booleaninthashCode()booleanisEmpty()Determine whether this object has no headers.iterator()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.toString()Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ConnectHeaders
public ConnectHeaders() -
ConnectHeaders
-
-
Method Details
-
size
public int size()Description copied from interface:HeadersGet the number of headers in this object. -
isEmpty
public boolean isEmpty()Description copied from interface:HeadersDetermine whether this object has no headers. -
clear
Description copied from interface:HeadersRemoves all headers from this object. -
add
Description copied from interface:HeadersAdd the givenHeaderto this collection. -
add
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.- Specified by:
addin interfaceHeaders- Parameters:
key- the header's key; may not be nullschemaAndValue- theSchemaAndValuefor the header; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
add
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addString
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addBytes
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addBoolean
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value.- Specified by:
addBooleanin interfaceHeaders- Parameters:
key- the header's key; may not be nullvalue- the header's value; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
addByte
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addShort
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addInt
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addLong
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addFloat
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addDouble
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addList
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addMap
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addStruct
Description copied from interface:HeadersAdd to this collection aHeaderwith the given key and value. -
addDecimal
Description copied from interface:Headers- Specified by:
addDecimalin interfaceHeaders- Parameters:
key- the header's key; may not be nullvalue- the header'sDecimalvalue; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
addDate
Description copied from interface:Headers -
addTime
Description copied from interface:Headers -
addTimestamp
Description copied from interface:Headers- Specified by:
addTimestampin interfaceHeaders- Parameters:
key- the header's key; may not be nullvalue- the header'sTimestampvalue; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
lastWithName
Description copied from interface:HeadersReturn the lastHeaderwith the specified key.- Specified by:
lastWithNamein interfaceHeaders- 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
-
allWithName
Description copied from interface:Headers- Specified by:
allWithNamein interfaceHeaders- 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
-
iterator
-
remove
Description copied from interface:Headers -
retainLatest
Description copied from interface:HeadersRemoves all but the lastHeaderobject with each key.- Specified by:
retainLatestin interfaceHeaders- Returns:
- this object to facilitate chaining multiple methods; never null
-
retainLatest
Description copied from interface:Headers- Specified by:
retainLatestin interfaceHeaders- Parameters:
key- the key; may not be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
apply
Description copied from interface:HeadersGet allHeaders with the given key, apply the transform to each and store the result in place of the original. -
apply
Description copied from interface:HeadersGet allHeaders, apply the transform to each and store the result in place of the original. -
hashCode
public int hashCode() -
equals
-
toString
-
duplicate
Description copied from interface:Headers
-