public class CaseInsensitivePersistentStore<V> extends Object implements PersistentStore<V>
PersistentStore
to ensure all passed keys are
converted to lower case and stored this way. This will ensure
case-insensitivity during insert, update, deletion or search.Constructor and Description |
---|
CaseInsensitivePersistentStore(PersistentStore<V> underlyingStore) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
contains(String key)
Checks if lookup key is present in store.
|
void |
delete(String key)
Removes the value corresponding to the given key if exists, nothing happens otherwise.
|
V |
get(String key)
Returns the value for the given key if exists, null otherwise.
|
Iterator<Map.Entry<String,V>> |
getAll()
Returns an iterator of entries.
|
PersistentStoreMode |
getMode()
Returns storage
mode of this store. |
Iterator<Map.Entry<String,V>> |
getRange(int skip,
int take)
Returns an iterator of desired number of entries offsetting by the skip value.
|
void |
put(String key,
V value)
Stores the (key, value) tuple in the store.
|
boolean |
putIfAbsent(String key,
V value)
Stores the (key, value) tuple in the store only if it does not exists.
|
public CaseInsensitivePersistentStore(PersistentStore<V> underlyingStore)
public boolean contains(String key)
PersistentStore
contains
in interface PersistentStore<V>
key
- lookup keypublic V get(String key)
PersistentStore
get
in interface PersistentStore<V>
key
- lookup keypublic void put(String key, V value)
PersistentStore
mode
.put
in interface PersistentStore<V>
key
- lookup keyvalue
- value to storepublic Iterator<Map.Entry<String,V>> getAll()
PersistentStore
getAll
in interface PersistentStore<V>
public PersistentStoreMode getMode()
Store
mode
of this store.public void delete(String key)
Store
public boolean putIfAbsent(String key, V value)
Store
putIfAbsent
in interface Store<V>
key
- lookup keyvalue
- value to storepublic Iterator<Map.Entry<String,V>> getRange(int skip, int take)
Store
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 1970 The Apache Software Foundation. All rights reserved.