Added destroy() method to DistributedPrimitive interface
Implement replace method in ConsistentMap
Using Versioned#valueOrNull in place of Versioned#valueOrElse where appropriate

Change-Id: Ief3f3547d589d35f5c821a1c47035f91078e8316
diff --git a/core/api/src/main/java/org/onosproject/store/service/DistributedPrimitive.java b/core/api/src/main/java/org/onosproject/store/service/DistributedPrimitive.java
index 6a6c09e..ed2e9c9 100644
--- a/core/api/src/main/java/org/onosproject/store/service/DistributedPrimitive.java
+++ b/core/api/src/main/java/org/onosproject/store/service/DistributedPrimitive.java
@@ -15,6 +15,8 @@
  */
 package org.onosproject.store.service;
 
+import java.util.concurrent.CompletableFuture;
+
 import org.onosproject.core.ApplicationId;
 
 /**
@@ -76,4 +78,15 @@
     default ApplicationId applicationId() {
         return null;
     }
+
+    /**
+     * Purges state associated with this primitive.
+     * <p>
+     * Implementations can override and provide appropriate clean up logic for purging
+     * any state state associated with the primitive. Whether modifications made within the
+     * destroy method have local or global visibility is left unspecified.
+     */
+    default CompletableFuture<Void> destroy() {
+        return CompletableFuture.completedFuture(null);
+    }
 }