Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Add javadoc and mark as FunctionalInterface callback interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Karczewski committed Jun 30, 2020
1 parent d17b31a commit 301f547
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/main/java/io/pmem/pmemkv/KeyCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@

package io.pmem.pmemkv;

/**
* Represents callback function, which handle value-only use cases. Such
* expression may be passed to get() method in Database class
*
* @param <KeyT>
* the type of a key stored in the pmemkv database
*/
@FunctionalInterface
public interface KeyCallback<KeyT> {

/**
* It's internally used as a middle layer to run callback function
*
* @param key
* the key returned by pmemkv engine to callback function
*/
void process(KeyT key);

}
19 changes: 18 additions & 1 deletion src/main/java/io/pmem/pmemkv/KeyValueCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,25 @@

package io.pmem.pmemkv;

/**
* Represents callback function, which handle value-only use cases. Such
* expression may be passed to get() method in Database class
*
* @param <KeyT>
* the type of a key stored in the pmemkv database
* @param <ValueT>
* the type of a value stored in the pmemkv database
*/
@FunctionalInterface
public interface KeyValueCallback<KeyT, ValueT> {

/**
* It's internally used as a middle layer to run callback function
*
* @param key
* the key returned by pmemkv engine to the callback function
* @param value
* the value returned by pmemkv engine to the callback function
*/
void process(KeyT key, ValueT value);

}
15 changes: 14 additions & 1 deletion src/main/java/io/pmem/pmemkv/ValueCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@

package io.pmem.pmemkv;

/**
* Represents callback function, which handle value-only use cases. Such
* expression may be passed to get*() methods in Database class
*
* @param <ValueT>
* the type of a key stored in the pmemkv database
*/
@FunctionalInterface
public interface ValueCallback<ValueT> {

/**
* It's internally used as a middle layer to run callback function
*
* @param value
* the value returned by pmemkv engine to the callback function
*/
void process(ValueT value);

}

0 comments on commit 301f547

Please sign in to comment.