@ SuppressWarnings ( "unchecked" ) public < X > StreamRecord < X > replace ( X value , long timestamp ) { this . timestamp = timestamp ; this . value = ( T ) value ; this . hasTimestamp = true ; return ( StreamRecord < X > ) this ; }
Replace the currently stored value by the given new value and the currently stored timestamp with the new timestamp . This returns a StreamElement with the generic type parameter that matches the new value .