CORD-413 Implement MPLS Termination in OFDPA3 pipeliner
Additionally, this patch includes
- Minor refactoring
- Skip method length checkstyle for FlowEntryBuilder::hasSetField
Change-Id: I7887f454f552a9e346c323524f359929deadf427
diff --git a/drivers/default/src/main/java/org/onosproject/driver/extensions/codec/OfdpaMatchVlanVidCodec.java b/drivers/default/src/main/java/org/onosproject/driver/extensions/codec/OfdpaMatchVlanVidCodec.java
index bc0e876..65ed92b 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/extensions/codec/OfdpaMatchVlanVidCodec.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/extensions/codec/OfdpaMatchVlanVidCodec.java
@@ -30,15 +30,14 @@
public class OfdpaMatchVlanVidCodec extends JsonCodec<OfdpaMatchVlanVid> {
private static final String VLAN_ID = "vlanId";
-
private static final String MISSING_MEMBER_MESSAGE = " member is required in OfdpaMatchVlanVid";
+ private static final String MISSING_VLAN_ID_MESSAGE = "Vlan ID cannot be null";
@Override
public ObjectNode encode(OfdpaMatchVlanVid vlanId, CodecContext context) {
- checkNotNull(vlanId, "Vlan ID cannot be null");
- ObjectNode root = context.mapper().createObjectNode()
+ checkNotNull(vlanId, MISSING_VLAN_ID_MESSAGE);
+ return context.mapper().createObjectNode()
.put(VLAN_ID, vlanId.vlanId().id());
- return root;
}
@Override