oracle.kv.impl.util.FastExternalizablepublic class Value
extends java.lang.Object
implements oracle.kv.impl.util.FastExternalizable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Value.Format |
Identifies the format of a value.
|
| Modifier and Type | Field | Description |
|---|---|---|
static Value |
EMPTY_VALUE |
An instance that represents an empty value for key-only records.
|
| Modifier and Type | Method | Description |
|---|---|---|
static Value |
createValue(byte[] val) |
Creates a Value from a value byte array.
|
boolean |
equals(java.lang.Object other) |
|
static Value |
fromByteArray(byte[] bytes) |
Deserializes the given bytes that were returned earlier by
toByteArray() and returns the resulting Value. |
Value.Format |
getFormat() |
Returns the value's format.
|
byte[] |
getValue() |
Returns the value byte array.
|
int |
hashCode() |
|
byte[] |
toByteArray() |
Returns this Value as a serialized byte array, such that
fromByteArray(byte[]) may be used to reconstitute the Value. |
java.lang.String |
toString() |
public static final Value EMPTY_VALUE
public byte[] toByteArray()
fromByteArray(byte[]) may be used to reconstitute the Value.
The intended use case for the toByteArray() and fromByteArray(byte[]) methods is to serialize values of various formats in a
uniform manner, for storage outside of NoSQL DB or for sending across a
network.
Values returned by calls to this method can be used with current and newer releases, but are not guaranteed to be compatible with earlier releases.
WARNING: The array returned by this method should be considered
to be opaque by the caller. This array is not necessarily equal to the
array returned by getValue(); in particular, the returned array
may contain an extra byte identifying the format. The only valid use of
this array is to pass it to fromByteArray(byte[]) at a later time in
order to reconstruct the Value object. Normally getValue() should be used instead of this method.
fromByteArray(byte[])public static Value fromByteArray(byte[] bytes)
toByteArray() and returns the resulting Value.
The intended use case for the toByteArray() and fromByteArray(byte[]) methods is to serialize values of various formats in a
uniform manner, for storage outside of NoSQL DB or for sending across a
network.
Values created with either the current or earlier releases can be used with this method, but values created by later releases are not guaranteed to be compatible.
WARNING: Misuse of this method could result in data corruption
if the returned object is added to the store. The array passed to this
method must have been previously created by calling fromByteArray(byte[]). To create a Value object of format Value.Format.NONE, call createValue(byte[]) instead.
toByteArray()public static Value createValue(byte[] val)
Value.Format.NONE. This method
may not be used to create Avro values; for that, use an AvroBinding instead.public byte[] getValue()
public Value.Format getFormat()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.