本文整理了Java中org.opendaylight.yangtools.yang.common.YangVersion.equals()
方法的一些代码示例,展示了YangVersion.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangVersion.equals()
方法的具体详情如下:
包路径:org.opendaylight.yangtools.yang.common.YangVersion
类名称:YangVersion
方法名:equals
暂无
代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950
private static boolean areFeaturesSupported(final StmtContext<?, ?, ?> subStmtCtx) {
/*
* In case of Yang 1.1, checks whether features are supported.
*/
return !YangVersion.VERSION_1_1.equals(subStmtCtx.getRootVersion()) || subStmtCtx.isSupportedByFeatures();
}
代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950
@Override
public Predicate<Set<QName>> parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
if (YangVersion.VERSION_1_1.equals(ctx.getRootVersion())) {
return IfFeaturePredicateVisitor.parseIfFeatureExpression(ctx, value);
}
final QName qname = StmtContextUtils.parseNodeIdentifier(ctx, value);
return setQNames -> setQNames.contains(qname);
}
代码示例来源:origin: opendaylight/yangtools
private static boolean isRelevantForIfFeatureAndWhenOnListKeysCheck(final StmtContext<?, ?, ?> ctx) {
return YangVersion.VERSION_1_1.equals(ctx.getRootVersion())
&& StmtContextUtils.hasParentOfType(ctx, YangStmtMapping.LIST)
&& StmtContextUtils.findFirstDeclaredSubstatement(ctx.coerceParentContext(),
KeyStatement.class) != null;
}
代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950
static void copyFromSourceToTarget(final StatementContextBase<?, ?, ?> sourceCtx,
final StatementContextBase<?, ?, ?> targetCtx) {
final CopyType typeOfCopy = UsesStatement.class.equals(sourceCtx.coerceParentContext().getPublicDefinition()
.getDeclaredRepresentationClass()) ? CopyType.ADDED_BY_USES_AUGMENTATION
: CopyType.ADDED_BY_AUGMENTATION;
/*
* Since Yang 1.1, if an augmentation is made conditional with a
* "when" statement, it is allowed to add mandatory nodes.
*/
final boolean skipCheckOfMandatoryNodes = YangVersion.VERSION_1_1.equals(sourceCtx.getRootVersion())
&& isConditionalAugmentStmt(sourceCtx);
final Collection<? extends Mutable<?, ?, ?>> declared = sourceCtx.mutableDeclaredSubstatements();
final Collection<? extends Mutable<?, ?, ?>> effective = sourceCtx.mutableEffectiveSubstatements();
final Collection<Mutable<?, ?, ?>> buffer = new ArrayList<>(declared.size() + effective.size());
for (final Mutable<?, ?, ?> originalStmtCtx : declared) {
if (originalStmtCtx.isSupportedByFeatures()) {
copyStatement(originalStmtCtx, targetCtx, typeOfCopy, buffer, skipCheckOfMandatoryNodes);
}
}
for (final Mutable<?, ?, ?> originalStmtCtx : effective) {
copyStatement(originalStmtCtx, targetCtx, typeOfCopy, buffer, skipCheckOfMandatoryNodes);
}
targetCtx.addEffectiveSubstatements(buffer);
}
代码示例来源:origin: opendaylight/yangtools
} else if (!RootStatementContext.DEFAULT_VERSION.equals(root.getRootVersion())
&& inProgressPhase == ModelProcessingPhase.SOURCE_LINKAGE) {
root = new RootStatementContext<>(this, def, ref, argument, root.getRootVersion(),
内容来源于网络,如有侵权,请联系作者删除!