当前位置: 首页>>代码示例>>Java>>正文


Java NshContextHeader类代码示例

本文整理汇总了Java中org.onosproject.net.NshContextHeader的典型用法代码示例。如果您正苦于以下问题:Java NshContextHeader类的具体用法?Java NshContextHeader怎么用?Java NshContextHeader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NshContextHeader类属于org.onosproject.net包,在下文中一共展示了NshContextHeader类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:NiciraSetNshContextHeaderCodec.java

示例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()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:NiciraSetNshContextHeaderTest.java

示例3: deserialize

import org.onosproject.net.NshContextHeader; //导入依赖的package包/类
@Override
public void deserialize(byte[] data) {
    Map<String, Object> values = appKryo.deserialize(data);
    nshCh = (NshContextHeader) values.get("nshCh");
    type = (ExtensionTreatmentType) values.get("type");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:NiciraSetNshContextHeader.java

示例4: 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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:10,代码来源:NiciraSetNshContextHeader.java

示例5: nshCh

import org.onosproject.net.NshContextHeader; //导入依赖的package包/类
/**
 * Gets the nsh context header.
 *
 * @return nsh context header
 */
public NshContextHeader nshCh() {
    return nshCh;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:NiciraSetNshContextHeader.java

示例6: nshContextHeader

import org.onosproject.net.NshContextHeader; //导入依赖的package包/类
/**
 * Gets the nsh context header to match.
 *
 * @return the nsh context header to match
 */
public NshContextHeader nshContextHeader() {
    return nshContextHeader;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:NiciraMatchNshContextHeader.java


注:本文中的org.onosproject.net.NshContextHeader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。