gpt4 book ai didi

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

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

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

YangPatternRestriction介绍

[英]Represents pattern restriction information. The regular expression restriction on string data type.
[中]表示模式限制信息。对字符串数据类型的正则表达式限制。

代码示例

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

/**
 * Adds a new pattern restriction for the type.
 *
 * @param newPattern new pattern restriction for the type
 */
public void addPattern(String newPattern) {
  if (patternRestriction == null) {
    patternRestriction = new YangPatternRestriction();
  }
  patternRestriction.addPattern(newPattern);
}

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

/**
 * Validates if the given value is correct as per the pattern restriction.
 *
 * @param valueInString value
 * @return true, if the value is confirming to pattern restriction, false otherwise
 */
boolean isValidStringOnPatternRestriction(String valueInString) {
  if (patternRestriction == null
      || patternRestriction.getPatternList().isEmpty()) {
    // Pattern restriction is optional
    return true;
  }
  ListIterator<String> patternListIterator =
      patternRestriction.getPatternList().listIterator();
  boolean isMatched = false;
  while (patternListIterator.hasNext()) {
    if (valueInString.matches(patternListIterator.next())) {
      isMatched = true;
      break;
    }
  }
  return isMatched;
}

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

for (String pattern : refPr.getPatternList()) {
  getPatternRestriction().addPattern(pattern);

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

.getDataTypeExtendedInfo()).getPatternRestriction();
if (patternRestriction == null) {
  patternRestriction = new YangPatternRestriction();
  ((YangDerivedInfo<?>) type.getDataTypeExtendedInfo()).setPatternRestriction(patternRestriction);
  patternRestriction.addPattern(patternArgument);
} else {
  ((YangDerivedInfo<?>) type.getDataTypeExtendedInfo()).setPatternRestriction(patternRestriction);
  patternRestriction.addPattern(patternArgument);

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