Skip to content

Instantly share code, notes, and snippets.

@xnull
Created June 1, 2019 06:37
Show Gist options
  • Save xnull/33b7ac722fddcbd96c7498f3a876f923 to your computer and use it in GitHub Desktop.
Save xnull/33b7ac722fddcbd96c7498f3a876f923 to your computer and use it in GitHub Desktop.
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