T
- The type encapsulated with the stream record.@Internal public final class StreamRecord<T> extends StreamElement
Constructor and Description |
---|
StreamRecord(T value)
Creates a new StreamRecord.
|
StreamRecord(T value,
long timestamp)
Creates a new StreamRecord wrapping the given value.
|
Modifier and Type | Method and Description |
---|---|
StreamRecord<T> |
copy(T valueCopy)
Creates a copy of this stream record.
|
void |
copyTo(T valueCopy,
StreamRecord<T> target)
Copies this record into the new stream record.
|
boolean |
equals(Object o) |
void |
eraseTimestamp() |
long |
getTimestamp()
Returns the timestamp associated with this stream value in milliseconds.
|
T |
getValue()
Returns the value wrapped in this stream value.
|
int |
hashCode() |
boolean |
hasTimestamp()
Checks whether this record has a timestamp.
|
<X> StreamRecord<X> |
replace(X element)
Replace the currently stored value by the given new value.
|
<X> StreamRecord<X> |
replace(X value,
long timestamp)
Replace the currently stored value by the given new value and the currently stored
timestamp with the new timestamp.
|
void |
setTimestamp(long timestamp) |
String |
toString() |
asRecord, asWatermark, isRecord, isWatermark
public StreamRecord(T value)
public StreamRecord(T value, long timestamp)
value
- The value to wrap in this StreamRecord
timestamp
- The timestamp in millisecondspublic T getValue()
public long getTimestamp()
public boolean hasTimestamp()
public <X> StreamRecord<X> replace(X element)
element
- Element to set in this stream valuepublic <X> StreamRecord<X> replace(X value, long timestamp)
value
- The new value to wrap in this StreamRecordtimestamp
- The new timestamp in millisecondspublic void setTimestamp(long timestamp)
public void eraseTimestamp()
public StreamRecord<T> copy(T valueCopy)
public void copyTo(T valueCopy, StreamRecord<T> target)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.