| Modifier and Type | Class and Description |
|---|---|
static class |
Map.Builder<K,V> |
| Constructor and Description |
|---|
Map(swaydb.Map<K,V> database)
Constructs the Map object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyFunction(K key,
K functionId)
Executes the registered function for this map.
|
Map<K,V> |
asJava()
Returns the java map of this map.
|
static <K,V> Map.Builder<K,V> |
builder()
Creates the builder.
|
void |
clear()
Clears this map.
|
void |
close()
Closes the database.
|
swaydb.data.accelerate.Level0Meter |
commit(swaydb.Prepare<K,V>... prepares)
Starts the commit function for this map.
|
boolean |
containsKey(K key)
Checks if a map contains key.
|
boolean |
containsValue(V value)
Checks if a map contains value.
|
static <K,V> Map<K,V> |
create(Object keySerializer,
Object valueSerializer)
Creates the map.
|
Set<Map.Entry<K,V>> |
entrySet()
Returns the entrues for this map.
|
LocalDateTime |
expiration(K key)
Returns the expiration date for key in this map.
|
V |
expire(K key,
LocalDateTime expireAt)
Setups the expiration at for key to this map.
|
V |
expire(K key,
long after,
TimeUnit timeUnit)
Setups the expiration after for key to this map.
|
void |
foreach(Consumer<Map.Entry<K,V>> consumer)
Starts the foreach function for this map.
|
Map<K,V> |
from(K key)
Returns the map object which starts from key for this map.
|
Map<K,V> |
fromOrAfter(K key)
Returns the map object which starts or after key for this map.
|
Map<K,V> |
fromOrBefore(K key)
Returns the map object which starts or before key for this map.
|
V |
get(K key)
Returns the value or null for key of this map.
|
Map.Entry<K,V> |
head()
Returns the head key for this map.
|
Optional<Map.Entry<K,V>> |
headOption()
Returns the optional head key for this map.
|
boolean |
isEmpty()
Checks the map is empty.
|
swaydb.Set<K> |
keys()
Returns the key objects for this map.
|
Set<K> |
keySet()
Returns the key set for this map.
|
K |
keysHead()
Returns the head key for this map.
|
Optional<K> |
keysHeadOption()
Returns the optional head key for this map.
|
int |
keySize(K key)
Returns the key size in bytes for this map.
|
K |
keysLast()
Returns the last key for this map.
|
Optional<K> |
keysLastOption()
Returns the optional last key for this map.
|
Map.Entry<K,V> |
last()
Returns the last key for this map.
|
Optional<Map.Entry<K,V>> |
lastOption()
Returns the optional last key for this map.
|
swaydb.data.accelerate.Level0Meter |
level0Meter()
Returns the level of meter for zerro level.
|
Optional<swaydb.data.compaction.LevelMeter> |
level1Meter()
Returns the level of meter for first level.
|
Optional<swaydb.data.compaction.LevelMeter> |
levelMeter(int levelNumber)
Returns the level of meter for level.
|
boolean |
mightContain(K key)
Checks if a map might contain key.
|
boolean |
nonEmpty()
Checks the map is not empty.
|
V |
put(K key,
V value)
Puts the key/value pair for this map.
|
V |
put(K key,
V value,
LocalDateTime expireAt)
Puts the key/value pair for this map with expiration at data.
|
V |
put(K key,
V value,
long expireAfter,
TimeUnit timeUnit)
Puts the key/value pair for this map with expiration after data.
|
void |
put(Map.Entry<K,V> entry)
Puts an entry object to this map.
|
void |
put(Map<K,V> map)
Puts a map object to this map.
|
K |
registerFunction(K functionId,
Function<V,swaydb.Apply.Map<V>> function)
Registers the function for this map.
|
V |
remove(K key)
Removes the value for key of this map.
|
void |
remove(K from,
K to)
Removes the values for keys of this map.
|
void |
remove(Set<K> keys)
Removes the values for key set of this map.
|
int |
size()
Returns the size of elements in this map.
|
long |
sizeOfSegments()
Returns the size for segments for this map.
|
Duration |
timeLeft(K key)
Returns the time left for key in this map.
|
V |
update(K key,
V value)
Updates the key/value for this map.
|
void |
update(Map<K,V> map)
Updates map entries for this map.
|
List<V> |
values()
Returns the values for this map.
|
int |
valueSize(V value)
Returns the value size in bytes for this map.
|
public int size()
public boolean isEmpty()
public boolean nonEmpty()
public LocalDateTime expiration(K key)
expiration in interface Map<K,V>key - the keypublic int keySize(K key)
public int valueSize(V value)
public long sizeOfSegments()
sizeOfSegments in interface Map<K,V>public swaydb.data.accelerate.Level0Meter level0Meter()
level0Meter in interface Map<K,V>public Optional<swaydb.data.compaction.LevelMeter> level1Meter()
public Optional<swaydb.data.compaction.LevelMeter> levelMeter(int levelNumber)
levelMeter in interface Map<K,V>levelNumber - the level numberpublic boolean containsKey(K key)
containsKey in interface Map<K,V>key - the keytrue if a map contains key, false otherwisepublic boolean mightContain(K key)
mightContain in interface Map<K,V>key - the keytrue if a map might contains key, false otherwisepublic Optional<Map.Entry<K,V>> headOption()
headOption in interface Map<K,V>public Optional<Map.Entry<K,V>> lastOption()
lastOption in interface Map<K,V>public boolean containsValue(V value)
containsValue in interface Map<K,V>value - the valuetrue if a map contains value, false otherwisepublic K keysHead()
public Optional<K> keysHeadOption()
keysHeadOption in interface Map<K,V>public K keysLast()
public Optional<K> keysLastOption()
keysLastOption in interface Map<K,V>public V put(K key, V value, long expireAfter, TimeUnit timeUnit)
public V put(K key, V value, LocalDateTime expireAt)
public V expire(K key, long after, TimeUnit timeUnit)
public V expire(K key, LocalDateTime expireAt)
public K registerFunction(K functionId, Function<V,swaydb.Apply.Map<V>> function)
registerFunction in interface Map<K,V>functionId - the functionIdfunction - the functionpublic void applyFunction(K key, K functionId)
applyFunction in interface Map<K,V>key - the keyfunctionId - the functionIdpublic Map<K,V> fromOrAfter(K key)
fromOrAfter in interface Map<K,V>key - the keypublic Map<K,V> fromOrBefore(K key)
fromOrBefore in interface Map<K,V>key - the keypublic swaydb.Set<K> keys()
public void foreach(Consumer<Map.Entry<K,V>> consumer)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic swaydb.data.accelerate.Level0Meter commit(swaydb.Prepare<K,V>... prepares)
public static <K,V> Map<K,V> create(Object keySerializer, Object valueSerializer)
K - the type of the key elementV - the type of the value elementkeySerializer - the keySerializervalueSerializer - the valueSerializerpublic static <K,V> Map.Builder<K,V> builder()
K - the type of the key elementV - the type of the value elementCopyright © 2019. All rights reserved.