use of org.onosproject.driver.extensions.NiciraSetNshContextHeader in project onos by opennetworkinglab.
the class NiciraSetNshContextHeaderCodec method decode.
@Override
public NiciraSetNshContextHeader decode(ObjectNode json, CodecContext context) {
if (json == null || !json.isObject()) {
return null;
}
// parse nsh context header
int contextHeaderInt = nullIsIllegal(json.get(NSH_CONTEXT_HEADER), NSH_CONTEXT_HEADER + MISSING_MEMBER_MESSAGE).asInt();
NshContextHeader contextHeader = NshContextHeader.of(contextHeaderInt);
// parse type
int extensionTypeInt = nullIsIllegal(json.get(TYPE), TYPE + MISSING_MEMBER_MESSAGE).asInt();
ExtensionTreatmentType type = new ExtensionTreatmentType(extensionTypeInt);
return new NiciraSetNshContextHeader(contextHeader, type);
}
Aggregations