本文整理汇总了Java中org.onosproject.net.flow.criteria.Criteria.matchLambda方法的典型用法代码示例。如果您正苦于以下问题:Java Criteria.matchLambda方法的具体用法?Java Criteria.matchLambda怎么用?Java Criteria.matchLambda使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.flow.criteria.Criteria
的用法示例。
在下文中一共展示了Criteria.matchLambda方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeCriterion
import org.onosproject.net.flow.criteria.Criteria; //导入方法依赖的package包/类
@Override
public Criterion decodeCriterion(ObjectNode json) {
JsonNode ochSignalId = nullIsIllegal(json.get(CriterionCodec.OCH_SIGNAL_ID),
CriterionCodec.GRID_TYPE + MISSING_MEMBER_MESSAGE);
GridType gridType =
GridType.valueOf(
nullIsIllegal(ochSignalId.get(CriterionCodec.GRID_TYPE),
CriterionCodec.GRID_TYPE + MISSING_MEMBER_MESSAGE).asText());
ChannelSpacing channelSpacing =
ChannelSpacing.valueOf(
nullIsIllegal(ochSignalId.get(CriterionCodec.CHANNEL_SPACING),
CriterionCodec.CHANNEL_SPACING + MISSING_MEMBER_MESSAGE).asText());
int spacingMultiplier = nullIsIllegal(ochSignalId.get(CriterionCodec.SPACING_MULIPLIER),
CriterionCodec.SPACING_MULIPLIER + MISSING_MEMBER_MESSAGE).asInt();
int slotGranularity = nullIsIllegal(ochSignalId.get(CriterionCodec.SLOT_GRANULARITY),
CriterionCodec.SLOT_GRANULARITY + MISSING_MEMBER_MESSAGE).asInt();
return Criteria.matchLambda(
Lambda.ochSignal(gridType, channelSpacing,
spacingMultiplier, slotGranularity));
}
示例2: matchOchSignal
import org.onosproject.net.flow.criteria.Criteria; //导入方法依赖的package包/类
/**
* Tests lambda criterion.
*/
@Test
public void matchOchSignal() {
Lambda ochSignal = Lambda.ochSignal(GridType.DWDM, ChannelSpacing.CHL_100GHZ, 4, 8);
Criterion criterion = Criteria.matchLambda(ochSignal);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}