public class ReusableEntry<KeyType> extends Object implements Grouper.Entry<KeyType>
Grouper.Entry
implementation that is reusable. Grouper.iterator(boolean)
allows reuse of Entries, and
so this class helps implementations taking advantage of that.Constructor and Description |
---|
ReusableEntry(KeyType key,
Object[] values) |
Modifier and Type | Method and Description |
---|---|
static <T> ReusableEntry<T> |
create(Grouper.KeySerde<T> keySerde,
int numValues)
Create a new instance based on a particular
Grouper.KeySerde and a particular Object values size. |
KeyType |
getKey()
Returns the key, which enables modifying the key.
|
Object[] |
getValues()
Returns the values array, which enables setting individual values.
|
void |
setKey(KeyType key)
Replaces the key completely.
|
void |
setValues(Object[] values)
Replaces the values array completely.
|
String |
toString() |
public static <T> ReusableEntry<T> create(Grouper.KeySerde<T> keySerde, int numValues)
Grouper.KeySerde
and a particular Object values size.public KeyType getKey()
getKey
in interface Grouper.Entry<KeyType>
public Object[] getValues()
getValues
in interface Grouper.Entry<KeyType>
public void setKey(KeyType key)
public void setValues(Object[] values)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.