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
-
Method Summary
Modifier and TypeMethodDescriptionAdd to this collection aHeader
with the given key and value.add
(String key, SchemaAndValue schemaAndValue) Add to this collection aHeader
with the given key and value.Add the givenHeader
to this collection.addBoolean
(String key, boolean value) Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.addDecimal
(String key, BigDecimal value) Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.Add to this collection aHeader
with the given key and value.addTimestamp
(String key, Date value) allWithName
(String key) apply
(String key, Headers.HeaderTransform transform) Get allHeader
s with the given key, apply the transform to each and store the result in place of the original.apply
(Headers.HeaderTransform transform) Get allHeader
s, 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 thisHeaders
object.boolean
int
hashCode()
boolean
isEmpty()
Determine whether this object has no headers.iterator()
lastWithName
(String key) Return the lastHeader
with the specified key.Removes all but the lastHeader
object with each key.retainLatest
(String key) int
size()
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:Headers
Get the number of headers in this object. -
isEmpty
public boolean isEmpty()Description copied from interface:Headers
Determine whether this object has no headers. -
clear
Description copied from interface:Headers
Removes all headers from this object. -
add
Description copied from interface:Headers
Add the givenHeader
to this collection. -
add
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value.- Specified by:
add
in interfaceHeaders
- Parameters:
key
- the header's key; may not be nullschemaAndValue
- theSchemaAndValue
for the header; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
add
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addString
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addBytes
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addBoolean
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value.- Specified by:
addBoolean
in 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:Headers
Add to this collection aHeader
with the given key and value. -
addShort
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addInt
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addLong
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addFloat
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addDouble
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addList
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addMap
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addStruct
Description copied from interface:Headers
Add to this collection aHeader
with the given key and value. -
addDecimal
Description copied from interface:Headers
- Specified by:
addDecimal
in interfaceHeaders
- Parameters:
key
- the header's key; may not be nullvalue
- the header'sDecimal
value; 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:
addTimestamp
in interfaceHeaders
- Parameters:
key
- the header's key; may not be nullvalue
- the header'sTimestamp
value; may be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
lastWithName
Description copied from interface:Headers
Return the lastHeader
with the specified key.- Specified by:
lastWithName
in 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:
allWithName
in 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:Headers
Removes all but the lastHeader
object with each key.- Specified by:
retainLatest
in interfaceHeaders
- Returns:
- this object to facilitate chaining multiple methods; never null
-
retainLatest
Description copied from interface:Headers
- Specified by:
retainLatest
in interfaceHeaders
- Parameters:
key
- the key; may not be null- Returns:
- this object to facilitate chaining multiple methods; never null
-
apply
Description copied from interface:Headers
Get allHeader
s with the given key, apply the transform to each and store the result in place of the original. -
apply
Description copied from interface:Headers
Get allHeader
s, 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
-