public class BinaryEnumObjectImpl extends Object implements BinaryObjectEx, Externalizable, CacheObject
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULAR| 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.
|
byte |
directType()
Gets message type.
|
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(CacheObjectContext 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(CacheObjectContext ctx) |
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(CacheObjectContext ctx,
boolean cpy) |
byte[] |
valueBytes(CacheObjectContext cacheCtx) |
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 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(CacheObjectContext ctx, boolean cpy)
value in interface CacheObjectctx - Context.cpy - If true need to copy value.public byte[] valueBytes(CacheObjectContext cacheCtx) throws IgniteCheckedException
valueBytes in interface CacheObjectcacheCtx - 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(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException
finishUnmarshal in interface CacheObjectctx - Context.ldr - Class loader.IgniteCheckedException - If failed.public void prepareMarshal(CacheObjectContext ctx) throws IgniteCheckedException
prepareMarshal in interface CacheObjectctx - Context.IgniteCheckedException - If failed.public void onAckReceived()
onAckReceived in interface Messagepublic byte 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. 1.9.0 Release Date : March 2 2017