diff --git a/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Condition.java b/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Condition.java
index e734e1f..f7414d9 100644
--- a/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Condition.java
+++ b/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Condition.java
@@ -21,6 +21,7 @@
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
 import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
+import java.util.Objects;
 
 /**
  * Immutable class representing a condition with name, field, match, value, action, and aggregation.
@@ -104,6 +105,52 @@
     }
 
     /**
+     * Checks if this Condition is equal to another object.
+     * The result is true if and only if the argument is not null and is a Condition object that
+     * has the same values for all fields.
+     *
+     * @param obj the object to compare this Condition against
+     * @return true if the given object represents a Condition equivalent to this one, false otherwise
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        Condition other = (Condition) obj;
+        return Objects.equals(name, other.name)
+                && Objects.equals(field, other.field)
+                && Objects.equals(match, other.match)
+                && Objects.equals(value, other.value)
+                && Objects.equals(action, other.action)
+                && Objects.equals(aggregation, other.aggregation);
+    }
+
+    /**
+     * Returns a hash code value for the Condition.
+     * This method is supported for the benefit of hash tables such as those provided by HashMap.
+     *
+     * @return a hash code value for this Condition
+     */
+    @Override
+    public int hashCode() {
+        int result = 17;
+        result = 59 * result + (name != null ? name.hashCode() : 0);
+        result = 59 * result + (field != null ? field.hashCode() : 0);
+        result = 59 * result + (match != null ? match.hashCode() : 0);
+        result = 59 * result + (value != null ? value.hashCode() : 0);
+        result = 59 * result + (action != null ? action.hashCode() : 0);
+        result = 59 * result + (aggregation != null ? aggregation.hashCode() : 0);
+        return result;
+    }
+
+    /**
      * Static method to create a new Builder instance.
      *
      * @return A new Builder for creating a Condition instance.
@@ -116,7 +163,6 @@
      * Builder class for Condition.
      */
     @JsonPOJOBuilder(withPrefix = "", buildMethodName = "build")
-    @JsonIgnoreProperties(ignoreUnknown = true)
     public static class Builder {
         private String name;
         private String field;
diff --git a/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Sort.java b/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Sort.java
index 585a6f8..fea91c9 100644
--- a/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Sort.java
+++ b/apps/aiplugin/api/src/main/java/org/onosproject/aiplugin/Sort.java
@@ -23,6 +23,7 @@
 import com.google.common.base.Preconditions;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Immutable class representing a sorting criteria with fields and an order.
@@ -62,6 +63,39 @@
     }
 
     /**
+     * Checks if this Sort is equal to another object.
+     * The result is true if and only if the argument is not null and is a Sort object with same fields and order.
+     *
+     * @param obj the object to compare this Sort against
+     * @return true if the given object represents a Sort equivalent to this Sort, false otherwise
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+                return true;
+        }
+        if (obj == null || getClass() != obj.getClass()) {
+                return false;
+        }
+        Sort selector = (Sort) obj;
+        return Objects.equals(fields, selector.fields) && Objects.equals(order, selector.order);
+    }
+
+    /**
+     * Returns a hash code value for the Sort.
+     * This method is supported for the benefit of hash tables such as those provided by HashMap.
+     *
+     * @return a hash code value for this Sort
+     */
+    @Override
+    public int hashCode() {
+        int result = 17;
+        result = 59 * result + (fields != null ? fields.hashCode() : 0);
+        result = 59 * result + (order != null ? order.hashCode() : 0);
+        return result;
+    }
+
+    /**
      * Static method to create a new Builder instance.
      *
      * @return A new Builder for creating a Sort instance.
