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