[VOL-4055][ONOS-8138] Adding annotations to meter to allow passing of associated information

This patch allows for adding key value elements in the meter request and in the meter generated from it.
An example is:
Annotations annotations = DefaultAnnotations.builder().set("MeterForDeviceType", "olt").build();
DefaultMeterRequest.builder().withAnnotations(annotations)
Generates:
 DefaultMeter{device=of:00000a0a0a0a0a0b, cellId=2, appId=org.opencord.olt, unit=KB_PER_SEC, isBurst=true, state=ADDED, bands=[DefaultBand{rate=100000, burst-size=5000, type=DROP, drop-precedence=null}, DefaultBand{rate=100000, burst-size=5000, type=DROP, drop-precedence=null}, DefaultBand{rate=100000, burst-size=0, type=DROP, drop-precedence=null}], annotations={MeterForDeviceType=olt}}

Change-Id: Ifaded96ebeb7956bc60cdf311180c984c3ba954e
diff --git a/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
index ad0256e..681846f 100644
--- a/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
+++ b/core/api/src/main/java/org/onosproject/net/meter/DefaultMeter.java
@@ -18,6 +18,8 @@
 import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableSet;
 import org.onosproject.core.ApplicationId;
+import org.onosproject.net.AbstractAnnotated;
+import org.onosproject.net.Annotations;
 import org.onosproject.net.DeviceId;
 
 import java.util.Collection;
@@ -30,7 +32,7 @@
 /**
  * A default implementation of a meter.
  */
-public final class DefaultMeter implements Meter, MeterEntry  {
+public final class DefaultMeter extends AbstractAnnotated implements Meter, MeterEntry {
 
 
     private final MeterCellId cellId;
@@ -47,7 +49,9 @@
     private long bytes;
 
     private DefaultMeter(DeviceId deviceId, MeterCellId cellId, ApplicationId appId,
-                         Unit unit, boolean burst, Collection<Band> bands) {
+                         Unit unit, boolean burst, Collection<Band> bands,
+                         Annotations... annotations) {
+        super(annotations);
         this.deviceId = deviceId;
         this.cellId = cellId;
         this.appId = appId;
@@ -158,7 +162,9 @@
                 .add("unit", unit)
                 .add("isBurst", burst)
                 .add("state", state)
-                .add("bands", bands).toString();
+                .add("bands", bands)
+                .add("annotations", annotations())
+                .toString();
     }
 
     @Override
@@ -189,6 +195,7 @@
         private boolean burst = false;
         private Collection<Band> bands;
         private DeviceId deviceId;
+        private Annotations annotations;
 
         @Override
         public Meter.Builder forDevice(DeviceId deviceId) {
@@ -233,13 +240,20 @@
         }
 
         @Override
+        public Builder withAnnotations(Annotations anns) {
+            this.annotations = anns;
+            return this;
+        }
+
+        @Override
         public DefaultMeter build() {
             checkNotNull(deviceId, "Must specify a device");
             checkNotNull(bands, "Must have bands.");
             checkArgument(!bands.isEmpty(), "Must have at least one band.");
             checkNotNull(appId, "Must have an application id");
             checkArgument(cellId != null, "Must specify a cell id.");
-            return new DefaultMeter(deviceId, cellId, appId, unit, burst, bands);
+            return new DefaultMeter(deviceId, cellId, appId, unit, burst, bands,
+                                    annotations);
         }