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)
PersistentStorecontains in interface PersistentStore<V>key - lookup keypublic V get(String key)
PersistentStoreget in interface PersistentStore<V>key - lookup keypublic void put(String key, V value)
PersistentStoremode.put in interface PersistentStore<V>key - lookup keyvalue - value to storepublic Iterator<Map.Entry<String,V>> getAll()
PersistentStoregetAll in interface PersistentStore<V>public PersistentStoreMode getMode()
Storemode of this store.public void delete(String key)
Storepublic boolean putIfAbsent(String key, V value)
StoreputIfAbsent in interface Store<V>key - lookup keyvalue - value to storepublic Iterator<Map.Entry<String,V>> getRange(int skip, int take)
Storepublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.