當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。