From 301f547f5d42a8a8605c4c515b44bfa1f0bd55bd Mon Sep 17 00:00:00 2001 From: Pawel Karczewski Date: Tue, 30 Jun 2020 19:06:06 +0200 Subject: [PATCH] Add javadoc and mark as FunctionalInterface callback interfaces --- src/main/java/io/pmem/pmemkv/KeyCallback.java | 15 ++++++++++++++- .../java/io/pmem/pmemkv/KeyValueCallback.java | 19 ++++++++++++++++++- .../java/io/pmem/pmemkv/ValueCallback.java | 15 ++++++++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/pmem/pmemkv/KeyCallback.java b/src/main/java/io/pmem/pmemkv/KeyCallback.java index f0bc5309..b46283f7 100644 --- a/src/main/java/io/pmem/pmemkv/KeyCallback.java +++ b/src/main/java/io/pmem/pmemkv/KeyCallback.java @@ -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 + * the type of a key stored in the pmemkv database + */ +@FunctionalInterface public interface KeyCallback { - + /** + * 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); } diff --git a/src/main/java/io/pmem/pmemkv/KeyValueCallback.java b/src/main/java/io/pmem/pmemkv/KeyValueCallback.java index 7af6e2e1..598fc077 100644 --- a/src/main/java/io/pmem/pmemkv/KeyValueCallback.java +++ b/src/main/java/io/pmem/pmemkv/KeyValueCallback.java @@ -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 + * the type of a key stored in the pmemkv database + * @param + * the type of a value stored in the pmemkv database + */ +@FunctionalInterface public interface KeyValueCallback { - + /** + * 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); } diff --git a/src/main/java/io/pmem/pmemkv/ValueCallback.java b/src/main/java/io/pmem/pmemkv/ValueCallback.java index 4b85c264..b690fb70 100644 --- a/src/main/java/io/pmem/pmemkv/ValueCallback.java +++ b/src/main/java/io/pmem/pmemkv/ValueCallback.java @@ -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 + * the type of a key stored in the pmemkv database + */ +@FunctionalInterface public interface ValueCallback { - + /** + * 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); }