You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/11/07 18:22:05 UTC
[camel] branch main updated: (chores) camel-resume-api: added missing documentation
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 509f2e53fd2 (chores) camel-resume-api: added missing documentation
509f2e53fd2 is described below
commit 509f2e53fd2ac00ec700bb6154ac66448ddbc833
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Nov 7 16:54:19 2022 +0100
(chores) camel-resume-api: added missing documentation
---
.../org/apache/camel/resume/Deserializable.java | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/core/camel-api/src/main/java/org/apache/camel/resume/Deserializable.java b/core/camel-api/src/main/java/org/apache/camel/resume/Deserializable.java
index 73a3d36b2f7..02e11ecc219 100644
--- a/core/camel-api/src/main/java/org/apache/camel/resume/Deserializable.java
+++ b/core/camel-api/src/main/java/org/apache/camel/resume/Deserializable.java
@@ -22,6 +22,12 @@ import java.nio.ByteBuffer;
public interface Deserializable {
+ /**
+ * Deserializes an arbitrary resumable object within a byte buffer
+ *
+ * @param buffer the buffer containing the object
+ * @return the deserialized object
+ */
default Object deserializeObject(ByteBuffer buffer) {
buffer.clear();
@@ -53,13 +59,32 @@ public interface Deserializable {
}
}
+ /**
+ * Deserializes the key data
+ *
+ * @param keyBuffer the buffer containing the key data
+ * @return the deserialized object
+ */
default Object deserializeKey(ByteBuffer keyBuffer) {
return deserializeObject(keyBuffer);
}
+ /**
+ * Deserializes the value of resumable data
+ *
+ * @param valueBuffer the buffer containing the value data
+ * @return the deserialized object
+ */
default Object deserializeValue(ByteBuffer valueBuffer) {
return deserializeObject(valueBuffer);
}
+ /**
+ * Deserializes resume data (invalid data may be ignored)
+ *
+ * @param keyBuffer the buffer containing the key data
+ * @param valueBuffer the buffer containing the value data
+ * @return true if successfully deserialized or false otherwise
+ */
boolean deserialize(ByteBuffer keyBuffer, ByteBuffer valueBuffer);
}