shishkovilja commented on code in PR #12916:
URL: https://github.com/apache/ignite/pull/12916#discussion_r3010286642


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java:
##########
@@ -77,10 +68,15 @@ public CacheEntryPredicateAdapter(@Nullable CacheObject 
val) {
     }
 
     /** */
-    public PredicateType type() {
+    public CacheEntryPredicateType type() {
         return type;
     }
 
+    /** */
+    public void type(CacheEntryPredicateType type) {

Review Comment:
   Redundant, should be removed.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java:
##########
@@ -130,93 +126,24 @@ public PredicateType type() {
 
     /** {@inheritDoc} */
     @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader 
ldr) throws IgniteCheckedException {
-        if (type == PredicateType.VALUE)
+        if (type == CacheEntryPredicateType.VALUE)
             val.finishUnmarshal(ctx.cacheObjectContext(), ldr);
     }
 
     /** {@inheritDoc} */
     @Override public void prepareMarshal(GridCacheContext ctx) throws 
IgniteCheckedException {
-        if (type == PredicateType.VALUE)
+        if (type == CacheEntryPredicateType.VALUE)
             val.prepareMarshal(ctx.cacheObjectContext());
     }
 
     /** */
-    public byte code() {
-        return code;
+    public @Nullable CacheObject value() {
+        return val;
     }
 
     /** */
-    public void code(byte code) {
-        this.code = code;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void prepareMarshal(Marshaller marsh) throws 
IgniteCheckedException {
-        switch (type) {
-            case OTHER:
-                code = 0;
-                break;
-
-            case VALUE:
-                code = 1;
-                break;
-
-            case HAS_VALUE:
-                code = 2;
-                break;
-
-            case HAS_NO_VALUE:
-                code = 3;
-                break;
-
-            case ALWAYS_FALSE:
-                code = 4;
-                break;
-
-            default:
-                throw new IllegalArgumentException("Unknown cache entry 
predicate type: " + type);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void finishUnmarshal(Marshaller marsh, ClassLoader 
clsLdr) throws IgniteCheckedException {
-        switch (code) {
-            case 0:
-                type = PredicateType.OTHER;
-                break;
-
-            case 1:
-                type = PredicateType.VALUE;
-                break;
-
-            case 2:
-                type = PredicateType.HAS_VALUE;
-                break;
-
-            case 3:
-                type = PredicateType.HAS_NO_VALUE;
-                break;
-
-            case 4:
-                type = PredicateType.ALWAYS_FALSE;
-                break;
-
-            default:
-                throw new IllegalArgumentException("Unknown cache entry 
predicate type code: " + code);
-        }
+    public void value(@Nullable CacheObject val) {

Review Comment:
   Redundant, should be removed.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java:
##########
@@ -130,93 +126,24 @@ public PredicateType type() {
 
     /** {@inheritDoc} */
     @Override public void finishUnmarshal(GridCacheContext ctx, ClassLoader 
ldr) throws IgniteCheckedException {
-        if (type == PredicateType.VALUE)
+        if (type == CacheEntryPredicateType.VALUE)
             val.finishUnmarshal(ctx.cacheObjectContext(), ldr);
     }
 
     /** {@inheritDoc} */
     @Override public void prepareMarshal(GridCacheContext ctx) throws 
IgniteCheckedException {
-        if (type == PredicateType.VALUE)
+        if (type == CacheEntryPredicateType.VALUE)
             val.prepareMarshal(ctx.cacheObjectContext());
     }
 
     /** */
-    public byte code() {
-        return code;
+    public @Nullable CacheObject value() {

Review Comment:
   Redundant, should be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to