T
- is the type of the deserialized object that is passed to toValue
and returned by toObject
. The specific
type depends on the particular binding that is used.public interface ValueBinding<T>
Value
s (stored byte
arrays) and typed objects representing that value. In other words, this
interface is used for serialization and deserialization of Value
s.
A built-in AvroBinding
, which is a ValueBinding
subtype, may
be obtained from the AvroCatalog
. Or, the ValueBinding
interface may be implemented directly by the application to create custom
bindings, when the Avro data format is not used.
WARNING: We strongly recommend using an AvroBinding
. NoSQL
DB will leverage Avro in the future to provide additional features and
capabilities.
AvroBinding
,
AvroCatalog
T toObject(Value value) throws RuntimeException
KVStore
method, the user
calls toObject
with the Value
obtained from the read
operation.value
- the Value
obtained from a KVStore
read
operation method.RuntimeException
- if a parameter value is disallowed by the
binding; see AvroBinding
for specific exceptions thrown when
using the Avro format.Value toValue(T object) throws RuntimeException
toValue
passing
an object she wishes to store. The resulting Value
is then
passed to the write operation method in KVStore
.object
- the object the user wishes to store, or at least
serialize.RuntimeException
- if a parameter value is disallowed by the
binding; see AvroBinding
for specific exceptions thrown when
using the Avro format.Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.