public class BinaryEnumObjectImpl extends Object implements BinaryObjectEx, Externalizable, CacheObject
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULARDIRECT_TYPE_SIZE| Constructor and Description |
|---|
BinaryEnumObjectImpl()
Externalizable support. |
BinaryEnumObjectImpl(BinaryContext ctx,
byte[] arr) |
BinaryEnumObjectImpl(BinaryContext ctx,
int typeId,
String clsName,
int ord)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
cacheObjectType() |
String |
className() |
BinaryObject |
clone()
Copies this binary object.
|
<T> T |
deserialize()
Gets fully deserialized instance of binary object.
|
short |
directType()
Gets message type.
|
String |
enumName()
Get name for this enum object.
|
int |
enumOrdinal()
Get ordinal for this enum object.
|
boolean |
equals(Object obj) |
<F> F |
field(String fieldName)
Gets field value.
|
byte |
fieldsCount()
Gets fields count.
|
void |
finishUnmarshal(CacheObjectValueContext ctx,
ClassLoader ldr) |
boolean |
hasField(String fieldName)
Checks whether field exists in the object.
|
int |
hashCode() |
boolean |
isFlagSet(short flag)
Check if flag set.
|
boolean |
isPlatformType()
Gets flag indicating whether object value is a platform type.
|
boolean |
isTypeEquals(Class<?> cls) |
void |
onAckReceived()
Method called when ack message received.
|
CacheObject |
prepareForCache(CacheObjectContext ctx)
Prepares cache object for cache (e.g. copies user-provided object if needed).
|
void |
prepareMarshal(CacheObjectValueContext ctx) |
boolean |
putValue(ByteBuffer buf) |
boolean |
putValue(ByteBuffer buf,
int off,
int len) |
int |
putValue(long addr) |
BinaryType |
rawType()
Get raw type.
|
void |
readExternal(ObjectInput in) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
BinaryObjectBuilder |
toBuilder()
Creates a new
BinaryObjectBuilder based on this binary object. |
String |
toString() |
BinaryType |
type()
Gets type information for this binary object.
|
int |
typeId() |
<T> T |
value(CacheObjectValueContext ctx,
boolean cpy) |
byte[] |
valueBytes(CacheObjectValueContext cacheCtx) |
int |
valueBytesLength(CacheObjectContext ctx) |
void |
writeExternal(ObjectOutput out) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
public BinaryEnumObjectImpl()
Externalizable support.public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsName, int ord)
ctx - Context.typeId - Type ID.clsName - Class name.ord - Ordinal.public BinaryEnumObjectImpl(BinaryContext ctx, byte[] arr)
ctx - Context.arr - Array.@Nullable public String className()
public int typeId()
typeId in interface BinaryObjectExpublic BinaryType type() throws BinaryObjectException
type in interface BinaryObjectBinaryObjectException - In case of error.@Nullable public BinaryType rawType() throws BinaryObjectException
rawType in interface BinaryObjectExBinaryObjectException - If failed.public boolean isFlagSet(short flag)
isFlagSet in interface BinaryObjectExflag - flag to check.true if flag is set, false otherwise.public <F> F field(String fieldName) throws BinaryObjectException
field in interface BinaryObjectfieldName - Field name.BinaryObjectException - In case of any other error.public boolean hasField(String fieldName)
hasField in interface BinaryObjectfieldName - Field name.True if field exists.public <T> T deserialize()
throws BinaryObjectException
deserialize in interface BinaryObjectBinaryInvalidTypeException - If class doesn't exist.BinaryObjectException - In case of any other error.public BinaryObject clone() throws CloneNotSupportedException
clone in interface BinaryObjectclone in class ObjectCloneNotSupportedExceptionpublic BinaryObjectBuilder toBuilder() throws BinaryObjectException
BinaryObjectBuilder based on this binary object. The following code
BinaryObjectBuilder builder = binaryObject.toBuilder();is equivalent to
BinaryObjectBuilder builder = ignite.binary().builder(binaryObject);
toBuilder in interface BinaryObjectBinaryObjectException - If builder cannot be created.public int enumOrdinal()
throws BinaryObjectException
BinaryType.isEnum() to check if object is of enum type.enumOrdinal in interface BinaryObjectBinaryObjectException - If object is not enum.public String enumName() throws BinaryObjectException
BinaryType.isEnum() to check if object is of enum type.enumName in interface BinaryObjectBinaryObjectException - If object is not enum.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException@Nullable public <T> T value(CacheObjectValueContext ctx, boolean cpy)
value in interface CacheObjectctx - Context.cpy - If true need to copy value.public byte[] valueBytes(CacheObjectValueContext cacheCtx) throws IgniteCheckedException
valueBytes in interface CacheObjectcacheCtx - Context.IgniteCheckedException - If failed.public boolean putValue(ByteBuffer buf) throws IgniteCheckedException
putValue in interface CacheObjectbuf - Buffer to write value to.True if value was successfully written, false if there was not enough space in the
buffer.IgniteCheckedException - If failed.public int putValue(long addr)
throws IgniteCheckedException
putValue in interface CacheObjectaddr - Address tp write value to.IgniteCheckedException - If failed.public boolean putValue(ByteBuffer buf, int off, int len) throws IgniteCheckedException
putValue in interface CacheObjectbuf - Buffer to write value to.off - Offset in source binary data.len - Length of the data to write.True if value was successfully written, false if there was not enough space in the
buffer.IgniteCheckedException - If failed.public int valueBytesLength(CacheObjectContext ctx) throws IgniteCheckedException
valueBytesLength in interface CacheObjectctx - Cache object context.IgniteCheckedException - If failed.public byte cacheObjectType()
cacheObjectType in interface CacheObjectpublic boolean isPlatformType()
IgniteCache.withKeepBinary() is used or not.isPlatformType in interface CacheObjectpublic CacheObject prepareForCache(CacheObjectContext ctx)
prepareForCache in interface CacheObjectctx - Cache context.public void finishUnmarshal(CacheObjectValueContext ctx, ClassLoader ldr) throws IgniteCheckedException
finishUnmarshal in interface CacheObjectctx - Context.ldr - Class loader.IgniteCheckedException - If failed.public void prepareMarshal(CacheObjectValueContext ctx) throws IgniteCheckedException
prepareMarshal in interface CacheObjectctx - Context.IgniteCheckedException - If failed.public void onAckReceived()
onAckReceived in interface Messagepublic short directType()
directType in interface Messagepublic byte fieldsCount()
fieldsCount in interface Messagepublic boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
public boolean isTypeEquals(Class<?> cls)
cls - type to examine.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.4.0 Release Date : March 5 2018