gpt4 book ai didi

org.onosproject.yangutils.datamodel.YangList.getKeyList()方法的使用及代码示例

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

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

YangList.getKeyList介绍

[英]Returns the list of key field names.
[中]返回关键字段名称的列表。

代码示例

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

/**
 * Adds a key field name.
 *
 * @param key key field name.
 * @throws DataModelException a violation of data model rules
 */
public void addKey(String key)
    throws DataModelException {
  if (getKeyList() == null) {
    setKeyList(new LinkedList<>());
  }
  if (getKeyList().contains(key)) {
    throw new DataModelException("A leaf identifier must not appear more than once in the\n" +
        "   key" +
        getName() + " in " +
        getLineNumber() + " at " +
        getCharPosition() +
        " in " + getFileName() + "\"");
  }
  getKeyList().add(key);
}

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

/**
 * Validates the data on exiting the corresponding parse tree node.
 *
 * @throws DataModelException a violation of data model rules
 */
@Override
public void validateDataOnExit()
    throws DataModelException {
  List<String> keys = getKeyList();
  List<YangLeaf> leaves = getListOfLeaf();
  List<YangLeafList> leafLists = getListOfLeafList();
  validateConfig(leaves, leafLists);
  //A list must have atleast one key leaf if config is true
  if (isConfig && (keys.isEmpty() || leaves.isEmpty()) && !isUsesPresentInList()
      && !isListPresentInGrouping()) {
    throw new DataModelException("A list must have atleast one key leaf if config is true; " +
        getName() + " in " +
        getLineNumber() + " at " +
        getCharPosition() +
        " in " + getFileName() + "\"");
  } else if (keys != null) {
    validateKey(leaves, keys);
  }
}

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

YangList list = (YangList) tmpData;
if (list.isConfig()) {
  for (String key : list.getKeyList()) {
    if (key.equals(leaf.getName())) {
      leaf.setKeyLeaf(true);

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