gpt4 book ai didi

org.onosproject.yangutils.datamodel.YangEnum类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 12:03:31 27 4
gpt4 key购买 nike

本文整理了Java中org.onosproject.yangutils.datamodel.YangEnum类的一些代码示例,展示了YangEnum类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangEnum类的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangEnum
类名称:YangEnum

YangEnum介绍

[英]Represents the ENUM data type information.
[中]表示枚举数据类型信息。

代码示例

代码示例来源:origin: org.onosproject/onos-yang-datamodel

@Override
  public int compareTo(YangEnum otherEnum) {
    if (namedValue.equals(otherEnum.getNamedValue())) {
      return 0;
    }
    return new Integer(value).compareTo(otherEnum.getValue());
  }
}

代码示例来源:origin: org.onosproject/onos-yang-utils-parser

/**
 * It is called when parser enters grammar rule (enum), it perform
 * validations and updates the data model tree.
 *
 * @param listener listener's object
 * @param ctx      context object of the grammar rule
 */
public static void processEnumEntry(TreeWalkListener listener, GeneratedYangParser.EnumStatementContext ctx) {
  // Check for stack to be non empty.
  checkStackIsNotEmpty(listener, MISSING_HOLDER, ENUM_DATA, ctx.string().getText(), ENTRY);
  YangEnum enumNode = new YangEnum();
  enumNode.setNamedValue(getValidNamedValue(ctx.string().getText()));
  enumNode.setLineNumber(ctx.getStart().getLine());
  enumNode.setCharPosition(ctx.getStart().getCharPositionInLine());
  enumNode.setFileName(listener.getFileName());
  listener.getParsedDataStack().push(enumNode);
}

代码示例来源:origin: org.onosproject/onos-yang-utils-parser

if (curEnum.getValue() == Integer.MAX_VALUE) {
    ParserException parserException = new ParserException("YANG file error : "
        + "An enum value MUST be specified for enum substatements following the one"
    parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
    throw parserException;
  } else if (maxValue <= curEnum.getValue()) {
    maxValue = curEnum.getValue();
    isValuePresent = true;
  maxValue++;
((YangEnum) tmpEnumNode).setValue(maxValue);

代码示例来源:origin: org.onosproject/onos-yang-utils-parser

YangEnumeration yangEnumeration = (YangEnumeration) tmpNode;
for (YangEnum curEnum : yangEnumeration.getEnumSet()) {
  if (value == curEnum.getValue()) {
    listener.getParsedDataStack().push(enumNode);
    return false;

代码示例来源:origin: org.onosproject/onos-yang-utils-parser

throw parserException;
enumNode.setValue(value);
break;

代码示例来源:origin: org.onosproject/onos-yang-datamodel

while (iterator.hasNext()) {
  YangEnum enumTemp = iterator.next();
  if (enumTemp.getNamedValue().equals(value)) {
    isValidated = true;
    break;

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com