本文整理汇总了Java中org.onosproject.net.NshContextHeader.of方法的典型用法代码示例。如果您正苦于以下问题:Java NshContextHeader.of方法的具体用法?Java NshContextHeader.of怎么用?Java NshContextHeader.of使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.NshContextHeader
的用法示例。
在下文中一共展示了NshContextHeader.of方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import org.onosproject.net.NshContextHeader; //导入方法依赖的package包/类
@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);
}
示例2: testConstruction
import org.onosproject.net.NshContextHeader; //导入方法依赖的package包/类
/**
* Checks the construction of a NiciraSetNshSi object.
*/
@Test
public void testConstruction() {
final NiciraSetNshContextHeader niciraSetNshCh = new NiciraSetNshContextHeader(NshContextHeader.of(10),
ExtensionTreatmentType.
ExtensionTreatmentTypes.
NICIRA_SET_NSH_CH1.type());
assertThat(niciraSetNshCh, is(notNullValue()));
assertThat(niciraSetNshCh.nshCh().nshContextHeader(), is(10));
assertThat(niciraSetNshCh.type(), is(ExtensionTreatmentType.
ExtensionTreatmentTypes.
NICIRA_SET_NSH_CH1.type()));
}
示例3: NiciraSetNshContextHeader
import org.onosproject.net.NshContextHeader; //导入方法依赖的package包/类
/**
* Creates a new set nsh context header instruction.
*
* @param type extension treatment type
*/
NiciraSetNshContextHeader(ExtensionTreatmentType type) {
this.nshCh = NshContextHeader.of(0);
this.type = type;
}