Remove unnecessary method calls by direct access to the field

Change-Id: If4420b9667ef30ec6a341124a8672b45f315cfb1
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java b/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java
index a15ed34..004964d 100644
--- a/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java
+++ b/core/api/src/main/java/org/onosproject/net/newresource/ContinuousResource.java
@@ -97,7 +97,7 @@
 
     @Override
     public int hashCode() {
-        return Objects.hash(id(), value);
+        return Objects.hash(id, value);
     }
 
     @Override
@@ -109,7 +109,7 @@
             return false;
         }
         final ContinuousResource other = (ContinuousResource) obj;
-        return Objects.equals(this.id(), other.id())
+        return Objects.equals(this.id, other.id)
                 && Objects.equals(this.value, other.value);
     }
 
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/DiscreteResource.java b/core/api/src/main/java/org/onosproject/net/newresource/DiscreteResource.java
index 9e9468a..a988989 100644
--- a/core/api/src/main/java/org/onosproject/net/newresource/DiscreteResource.java
+++ b/core/api/src/main/java/org/onosproject/net/newresource/DiscreteResource.java
@@ -80,7 +80,7 @@
     public DiscreteResource child(Object child) {
         checkArgument(!(child instanceof Class<?>));
 
-        return new DiscreteResource(id().child(child));
+        return new DiscreteResource(id.child(child));
     }
 
     @Override
@@ -96,7 +96,7 @@
     @Override
     public int hashCode() {
         // the value returing from volume() is excluded due to optimization
-        return id().hashCode();
+        return id.hashCode();
     }
 
     @Override
@@ -109,7 +109,7 @@
         }
         final DiscreteResource other = (DiscreteResource) obj;
         // the value returing from volume() is excluded due to optimization
-        return Objects.equals(this.id(), other.id());
+        return Objects.equals(this.id, other.id);
     }
 
     @Override