Class ValueAndTimestamp<V>

java.lang.Object
org.apache.kafka.streams.state.ValueAndTimestamp<V>
Type Parameters:
V -

public final class ValueAndTimestamp<V> extends Object
Combines a value from a KeyValue with a timestamp.
  • Method Details Link icon

    • make Link icon

      public static <V> ValueAndTimestamp<V> make(V value, long timestamp)
      Create a new ValueAndTimestamp instance if the provided value is not null.
      Type Parameters:
      V - the type of the value
      Parameters:
      value - the value
      timestamp - the timestamp
      Returns:
      a new ValueAndTimestamp instance if the provided value is not null; otherwise null is returned
    • makeAllowNullable Link icon

      public static <V> ValueAndTimestamp<V> makeAllowNullable(V value, long timestamp)
      Create a new ValueAndTimestamp instance. The provided value may be null.
      Type Parameters:
      V - the type of the value
      Parameters:
      value - the value
      timestamp - the timestamp
      Returns:
      a new ValueAndTimestamp instance
    • getValueOrNull Link icon

      public static <V> V getValueOrNull(ValueAndTimestamp<V> valueAndTimestamp)
      Return the wrapped value of the given valueAndTimestamp parameter if the parameter is not null.
      Type Parameters:
      V - the type of the value
      Parameters:
      valueAndTimestamp - a ValueAndTimestamp instance; can be null
      Returns:
      the wrapped value of valueAndTimestamp if not null; otherwise null
    • value Link icon

      public V value()
    • timestamp Link icon

      public long timestamp()
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object