add reset command + exists method for data source
This commit is contained in:
parent
9f33889604
commit
7cc9395cbc
6 changed files with 172 additions and 2 deletions
|
@ -53,4 +53,11 @@ public interface DataHandler {
|
|||
* @param key The key to remove the value from
|
||||
*/
|
||||
void remove(@NotNull String key);
|
||||
|
||||
/**
|
||||
* Check if a key exists in the data source
|
||||
* @param key The key to check
|
||||
* @return If the key exists
|
||||
*/
|
||||
boolean exists(@NotNull String key);
|
||||
}
|
||||
|
|
|
@ -94,4 +94,14 @@ public class Redis implements DataHandler {
|
|||
public void remove(@NotNull String key) {
|
||||
client.del(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a key exists
|
||||
* @param key The key to check
|
||||
* @return If the key exists
|
||||
*/
|
||||
@Override
|
||||
public boolean exists(@NotNull String key) {
|
||||
return client.exists(key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue