public class EnumBytesMarshaller<E extends Enum<E>> extends Object implements BytesMarshaller<E>
Constructor and Description |
---|
EnumBytesMarshaller(Class<E> classMarshaled,
E defaultValue) |
Modifier and Type | Method and Description |
---|---|
E |
read(Bytes bytes)
Reads and returns an object from
bytes . |
E |
read(Bytes bytes,
E e)
Reads and returns an object from
bytes , reusing the given object, if possible. |
void |
write(Bytes bytes,
E e)
Write the object out to the
bytes . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read
public void write(@NotNull Bytes bytes, @Nullable E e)
BytesMarshaller
bytes
.write
in interface BytesMarshaller<E extends Enum<E>>
bytes
- to write toe
- the object to writepublic E read(@NotNull Bytes bytes)
BytesMarshaller
bytes
.read
in interface BytesMarshaller<E extends Enum<E>>
bytes
- to read@Nullable public final E read(Bytes bytes, @Nullable E e)
BytesMarshaller
bytes
, reusing the given object, if possible.read
in interface BytesMarshaller<E>
bytes
- to reade
- an object to reuse, if possible. null
could be passed, in this case
a new object should be allocated anyway.Copyright © 2019. All rights reserved.