Class InMemoryDefaultKeyValueTable
- java.lang.Object
-
- com.snowflake.connectors.common.table.InMemoryDefaultKeyValueTable
-
- All Implemented Interfaces:
com.snowflake.connectors.common.table.KeyValueTable
public class InMemoryDefaultKeyValueTable extends Object implements com.snowflake.connectors.common.table.KeyValueTable
In memory implementation ofKeyValueTable.
-
-
Constructor Summary
Constructors Constructor Description InMemoryDefaultKeyValueTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this table.voiddelete(String key)Variantfetch(String key)Map<String,Variant>fetchAll()List<Variant>getAllWhere(Column filter)Map<String,FakeKeyValue>getRepository()Returns the map backing this table.voidsetGetAllWherePredicate(Predicate<Map.Entry<String,FakeKeyValue>> getAllWherePredicate)Sets the predicate used bygetAllWhere(Column)method.voidupdate(String key, Variant value)voidupdateAll(List<com.snowflake.connectors.common.table.KeyValue> keyValues)voidupdateMany(List<String> ids, String fieldName, Variant fieldValue)
-
-
-
Method Detail
-
fetch
public Variant fetch(String key)
- Specified by:
fetchin interfacecom.snowflake.connectors.common.table.KeyValueTable
-
fetchAll
public Map<String,Variant> fetchAll()
- Specified by:
fetchAllin interfacecom.snowflake.connectors.common.table.KeyValueTable
-
update
public void update(String key, Variant value)
- Specified by:
updatein interfacecom.snowflake.connectors.common.table.KeyValueTable
-
getAllWhere
public List<Variant> getAllWhere(Column filter)
- Specified by:
getAllWherein interfacecom.snowflake.connectors.common.table.KeyValueTable
-
setGetAllWherePredicate
public void setGetAllWherePredicate(Predicate<Map.Entry<String,FakeKeyValue>> getAllWherePredicate)
Sets the predicate used bygetAllWhere(Column)method.- Parameters:
getAllWherePredicate- new predicate
-
updateMany
public void updateMany(List<String> ids, String fieldName, Variant fieldValue)
- Specified by:
updateManyin interfacecom.snowflake.connectors.common.table.KeyValueTable
-
updateAll
public void updateAll(List<com.snowflake.connectors.common.table.KeyValue> keyValues)
- Specified by:
updateAllin interfacecom.snowflake.connectors.common.table.KeyValueTable
-
delete
public void delete(String key)
- Specified by:
deletein interfacecom.snowflake.connectors.common.table.KeyValueTable
-
getRepository
public Map<String,FakeKeyValue> getRepository()
Returns the map backing this table.- Returns:
- map backing this table
-
clear
public void clear()
Clears this table.
-
-