Class ByteBufferMarshalledValue<V>
java.lang.Object
org.wildfly.clustering.marshalling.ByteBufferMarshalledValue<V>
- Type Parameters:
V- the type wrapped by this marshalled value
- All Implemented Interfaces:
Serializable, MarshalledValue<V, ByteBufferMarshaller>
- Direct Known Subclasses:
ByteBufferMarshalledKey
public class ByteBufferMarshalledValue<V>
extends Object
implements MarshalledValue<V, ByteBufferMarshaller>, Serializable
MarshalledValue implementation that uses a ByteBufferMarshaller.- Author:
- Paul Ferraro
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionByteBufferMarshalledValue(ByteBuffer buffer) Constructs a marshalled value from the specified byte buffer.ByteBufferMarshalledValue(V object, ByteBufferMarshaller marshaller) Constructs a marshalled value from the specified object and marshaller. -
Method Summary
Modifier and TypeMethodDescriptionbooleanget(ByteBufferMarshaller marshaller) Returns the value, unmarshalling using the specified context if necessary.Returns the byte buffer of this value, marshalling it if necessary.inthashCode()booleanisEmpty()Indicates whether or not this value is empty.size()If present, returns the size of the buffer returned bygetBuffer().toString()
-
Constructor Details
-
ByteBufferMarshalledValue
Constructs a marshalled value from the specified object and marshaller.- Parameters:
object- the wrapped objectmarshaller- a marshaller suitable for marshalling the specified object
-
ByteBufferMarshalledValue
Constructs a marshalled value from the specified byte buffer. This constructor is only public to facilitate marshallers of this object (from other packages). The byte buffer parameter must not be read outside the context of this object.- Parameters:
buffer- a byte buffer
-
-
Method Details
-
isEmpty
public boolean isEmpty()Indicates whether or not this value is empty.- Returns:
- true, if this value is empty, false otherwise
-
getBuffer
Returns the byte buffer of this value, marshalling it if necessary.- Returns:
- the byte buffer of this value.
- Throws:
IOException- if the value could not be marshalled
-
size
If present, returns the size of the buffer returned bygetBuffer().- Returns:
- an optional buffer size
-
get
Description copied from interface:MarshalledValueReturns the value, unmarshalling using the specified context if necessary.- Specified by:
getin interfaceMarshalledValue<V, ByteBufferMarshaller>- Parameters:
marshaller- a marshalling context- Returns:
- the value wrapped by this marshalled value.
- Throws:
IOException- if the value could not be unmarshalled.
-
hashCode
-
equals
-
toString
-