K
- the map key typeV
- the map value typeR
- the return type of MapEntryOperations
specified for the queried mappublic interface MapContext<K,V,R> extends SetContext<K,R>, MapEntryOperations<K,V,R>, DefaultValueProvider<K,V>
MapEntries
are accessed. MapContext
allows to access
MapEntryOperations
, configured for the accessed ChronicleMap
via ChronicleMapBuilder.entryOperations(MapEntryOperations)
. MapContext
implements MapEntryOperations
by delegation to the configured entryOperations
. The same for
DefaultValueProvider
: MapContext
delegates to the DefaultValueProvider
configured for the accessed ChronicleMap
via ChronicleMapBuilder.defaultValueProvider(DefaultValueProvider)
, or the default DefaultValueProvider
implementation.Modifier and Type | Method and Description |
---|---|
ChronicleHash<K,?,?,?> |
hash()
Returns the accessed
ChronicleMap . |
ChronicleMap<K,V> |
map()
Returns the accessed
ChronicleMap . |
Data<V> |
wrapValueAsData(V value)
Wraps the given value as a
Data . |
Data<V> |
wrapValueBytesAsData(net.openhft.chronicle.bytes.BytesStore valueBytes,
long offset,
long size)
Wraps the given value bytes as a
Data . |
set
insert, remove
insert, remove, replaceValue
defaultValue
ChronicleHash<K,?,?,?> hash()
ChronicleMap
. Synonym to map()
.hash
in interface HashContext<K>
hash
in interface SetContext<K,R>
ChronicleMap<K,V> map()
ChronicleMap
. Synonym to hash()
.Data<V> wrapValueAsData(V value)
Data
. Useful when you need to pass a value
to some method accepting Data
, for example, MapEntryOperations.replaceValue(
MapEntry, Data)
, without allocating new objects (i. e. garbage) and ThreadLocals
.
The returned Data
object shouldn't outlive this MapContext
.
value
- the value object to wrapData
Data<V> wrapValueBytesAsData(net.openhft.chronicle.bytes.BytesStore valueBytes, long offset, long size)
Data
. Useful when you need to pass a value
to some method accepting Data
, for example, MapEntryOperations.replaceValue(
MapEntry, Data)
, without allocating manual deserialization and ThreadLocals
.
The returned Data
object shouldn't outlive this MapContext
.
valueBytes
- the value bytes to wrapoffset
- offset within the given valueBytes, the actual value bytes start fromsize
- length of the value bytes sequenceData
Copyright © 2020. All rights reserved.