Define sub-types of Bandwidth to reduce round-off error
Two sub-types are defined
- LongBandwidth
- DoubleBandwidth
LongBandwidth can reduce round-off error cause by floating point arithmetics.
These classes are not exposed outside the package and only instantiated
through static factory methods.
Change-Id: Ice5d8ff1397c9dd9c8c1fff46af256fff08fa616
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index 7223d57..16a2a99 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -267,6 +267,8 @@
.register(VlanId.class)
.register(Frequency.class)
.register(Bandwidth.class)
+ .register(Bandwidth.bps(1L).getClass())
+ .register(Bandwidth.bps(1.0).getClass())
.build();
/**
@@ -283,7 +285,7 @@
.register(BASIC)
.nextId(KryoNamespace.INITIAL_ID + 30)
.register(MISC)
- .nextId(KryoNamespace.INITIAL_ID + 30 + 10)
+ .nextId(KryoNamespace.INITIAL_ID + 30 + 20)
.register(
Instructions.MeterInstruction.class,
MeterId.class,