Created
June 1, 2019 06:37
-
-
Save xnull/33b7ac722fddcbd96c7498f3a876f923 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Create<K extends Key, V extends Value, Result> { | |
K key(); | |
V value(); | |
Result get(); | |
} | |
interface CrudManager { | |
<K extends Key, R extends OperationResult<String>> | |
Get<K, R> getOp(); | |
default <K extends Key, V extends Value> | |
Create<K, V, OperationResult<Record<K, V, Version>>> createOp(K key, V value) { | |
return new Create<K, V, OperationResult<Record<K, V, Version>>>() { | |
@Override | |
public K key() { | |
return key; | |
} | |
@Override | |
public V value() { | |
return value; | |
} | |
@Override | |
public OperationResult<Record<K, V, Version>> get() { | |
//CorfuTable corfuTable = null; | |
//return corfuTable.put(); | |
Version<?> v = null; | |
Record<K, V, Version> record = new Record<>(key, value, v); | |
return new OperationResult<>(record); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment