K
- the type of the keyV
- the type of the valuepublic class Record<K,V> extends Object
This class is used by application willing to configure the written record. The couple key/value is used for, respectively, the record's key and record's value. Instances are used as message's payload.
Both key and value can be null
. Instances of this class are immutable.
If the application needs to configure more aspect of the record, use the
OutgoingCloudEventMetadata
.
If the attached metadata configures the key, the key provided by the record is overidden.
Modifier and Type | Method and Description |
---|---|
K |
key() |
static <K,V> Record<K,V> |
of(K key,
V value)
Creates a new record.
|
V |
value() |
<T> Record<T,V> |
withKey(T key)
Creates a new instance of
Record with given key and the value from the current record. |
<T> Record<K,T> |
withValue(T value)
Creates a new instance of
Record with the key from the current record and the new value. |
public static <K,V> Record<K,V> of(K key, V value)
K
- the type of the keyV
- the type of the valuekey
- the key, can be null
value
- the value, can be null
public K key()
null
public V value()
null
public <T> Record<T,V> withKey(T key)
Record
with given key and the value from the current record.T
- the type of the new keykey
- the new key, can be null
Copyright © 2018–2021 SmallRye. All rights reserved.