V
- type of the accessed objectsT
- type of the handle for bytes accesspublic interface Value<V,T>
Bytes access: access()
+ handle()
+ offset()
+ size()
.
Object access: get()
.
In most cases, each particular value wraps either some object or some bytes. Object is marshalled to bytes lazily on demand, and bytes are lazily deserialized to object, accordingly.
Modifier and Type | Method and Description |
---|---|
ReadAccess<T> |
access()
Returns access to the value's bytes.
|
static <T1,T2> boolean |
bytesEquivalent(Value<?,T1> v1,
Value<?,T2> v2) |
default <S,T2,A extends ReadAccess<T2>> |
equivalent(Accessor<S,T2,A> accessor,
S source,
long index) |
default <T2> boolean |
equivalent(ReadAccess<T2> access,
T2 handle,
long offset) |
V |
get()
Returns "cached" object, generally not eligible for using outside some context, or a block,
synchronized with locks, or lambda, etc.
|
V |
getUsing(V usingInstance)
Reads the object from the value's bytes, trying to reuse the given object
(might be
null ). |
T |
handle()
Returns a handle to access the value's bytes.
|
default long |
hash(LongHashFunction f) |
long |
offset()
Returns the offset to the value's bytes.
|
long |
size()
Returns the size of the value's bytes.
|
default <S,T2,A extends WriteAccess<T2>> |
writeTo(Accessor<S,T2,A> accessor,
S source,
long index) |
default <T2> void |
writeTo(StreamingDataOutput<?,?,T2> output) |
default <T2> void |
writeTo(WriteAccess<T2> access,
T2 handle,
long offset) |
ReadAccess<T> access()
T handle()
long offset()
long size()
default long hash(LongHashFunction f)
default <T2> boolean equivalent(ReadAccess<T2> access, T2 handle, long offset)
default <S,T2,A extends ReadAccess<T2>> boolean equivalent(Accessor<S,T2,A> accessor, S source, long index)
default <T2> void writeTo(WriteAccess<T2> access, T2 handle, long offset)
default <T2> void writeTo(StreamingDataOutput<?,?,T2> output)
default <S,T2,A extends WriteAccess<T2>> void writeTo(Accessor<S,T2,A> accessor, S source, long index)
V get()
Value
is object wrapper -- this method just returns this object.V getUsing(@Nullable V usingInstance)
null
).Copyright © 2015. All rights reserved.