You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2021/11/22 19:14:17 UTC
[commons-jcs] 04/07: Prepare for immutable object
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git
commit 7007eec0f064a1dfd71e482054683482788a6d48
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Mon Nov 22 18:57:32 2021 +0100
Prepare for immutable object
---
.../lateral/LateralElementDescriptor.java | 64 ++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralElementDescriptor.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralElementDescriptor.java
index 102975f..8a421e7 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralElementDescriptor.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/lateral/LateralElementDescriptor.java
@@ -52,6 +52,7 @@ public class LateralElementDescriptor<K, V>
public int valHashCode = -1;
/** Constructor for the LateralElementDescriptor object */
+ @Deprecated // Not used
public LateralElementDescriptor()
{
}
@@ -67,6 +68,69 @@ public class LateralElementDescriptor<K, V>
}
/**
+ * Constructor for the LateralElementDescriptor object
+ * <p>
+ * @param ce ICacheElement<K, V> payload
+ * @param command operation requested by the client
+ */
+ public LateralElementDescriptor( final ICacheElement<K, V> ce, LateralCommand command)
+ {
+ this(ce);
+ this.command = command;
+ }
+
+ /**
+ * Constructor for the LateralElementDescriptor object
+ * <p>
+ * @param ce ICacheElement<K, V> payload
+ * @param command operation requested by the client
+ * @param requesterId id of the the source of the request
+ */
+ public LateralElementDescriptor( final ICacheElement<K, V> ce, LateralCommand command, long requesterId)
+ {
+ this(ce, command);
+ this.requesterId = requesterId;
+ }
+
+ /**
+ * Return payload
+ *
+ * @return the ce
+ */
+ public ICacheElement<K, V> getPayload()
+ {
+ return ce;
+ }
+
+ /**
+ * Return id of the the source of the request
+ *
+ * @return the requesterId
+ */
+ public long getRequesterId()
+ {
+ return requesterId;
+ }
+
+ /**
+ * Return operation requested by the client
+ *
+ * @return the command
+ */
+ public LateralCommand getCommand()
+ {
+ return command;
+ }
+
+ /**
+ * @return the valHashCode
+ */
+ public int getValHashCode()
+ {
+ return valHashCode;
+ }
+
+ /**
* @return String, all the important values that can be configured
*/
@Override