RefDataProcessingInfoSerde implements
        Serde<RefDataProcessingInfo>,
        Serializer<RefDataProcessingInfo>,
        Deserializer<RefDataProcessingInfo> { public static ProcessingState extractProcessingState(final ByteBuffer byteBuffer) { byte bState = byteBuffer.get(PROCESSING_STATE_OFFSET); return ProcessingState.fromByte(bState); }  @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 testExtractProcessingState() { for (ProcessingState processingState : ProcessingState.values()) { RefDataProcessingInfo refDataProcessingInfo = new RefDataProcessingInfo( 0L, 1000L, 100L, processingState); ByteBuffer valueBuffer = serialize(refDataProcessingInfo); ProcessingState foundProcessingState = RefDataProcessingInfoSerde.extractProcessingState(valueBuffer); assertThat(foundProcessingState).isEqualTo(processingState); } }