RefDataProcessingInfoSerde implements
        Serde<RefDataProcessingInfo>,
        Serializer<RefDataProcessingInfo>,
        Deserializer<RefDataProcessingInfo> { public void updateState(final ByteBuffer byteBuffer, final ProcessingState newProcessingState) { byteBuffer.put(PROCESSING_STATE_OFFSET, newProcessingState.getId()); }  @Override RefDataProcessingInfo deserialize(final ByteBuffer byteBuffer); @Override void serialize(final ByteBuffer byteBuffer, final RefDataProcessingInfo refDataProcessingInfo); void updateState(final ByteBuffer byteBuffer,
                                   final ProcessingState newProcessingState); void updateLastAccessedTime(final ByteBuffer byteBuffer, final long newLastAccessedTimeEpochMs); void updateLastAccessedTime(final ByteBuffer byteBuffer); static ProcessingState extractProcessingState(final ByteBuffer byteBuffer); static long extractLastAccessedTimeMs(final ByteBuffer byteBuffer); static boolean wasAccessedAfter(final ByteBuffer processingInfoBuffer, final ByteBuffer timeMsBuffer); @Override int getBufferCapacity(); static final int CREATE_TIME_OFFSET; static final int LAST_ACCESSED_TIME_OFFSET; static final int EFFECTIVE_TIME_OFFSET; static final int PROCESSING_STATE_OFFSET; }
@Test void testUpdateState() { final RefDataProcessingInfo input = new RefDataProcessingInfo( 1, 1, 1, ProcessingState.LOAD_IN_PROGRESS); final RefDataProcessingInfo expectedOutput = new RefDataProcessingInfo( 1, 1, 1, ProcessingState.COMPLETE); doByteBufferModificationTest( input, expectedOutput, (serde, byteBuffer) -> serde.updateState(byteBuffer, ProcessingState.COMPLETE)); }