gpt4 book ai didi

org.opendaylight.yangtools.yang.xpath.api.YangFunctionCallExpr类的使用及代码示例

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

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

YangFunctionCallExpr介绍

[英]Function call invocation. Function names without a prefix are mapped into YangConstants#RFC6020_YIN_MODULE, as they are required to be mapped into YANG as per RFC7950 definitions.
[中]函数调用。没有前缀的函数名被映射到YangConstants#RFC6020_YIN_模块,因为根据RFC7950的定义,它们需要映射到YANG。

代码示例

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr numberExpr(final List<YangExpr> args) {
  checkArgument(args.size() <= 1, "number(object?) takes at most one argument");
  if (args.isEmpty()) {
    return NUMBER;
  }
  final YangExpr arg = args.get(0);
  if (arg instanceof YangNumberExpr) {
    return arg;
  }
  // TODO: constant literal folding requires math support
  return YangFunctionCallExpr.of(YangFunction.NUMBER.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-api

@Override
public final int hashCode() {
  return Objects.hash(getName(), getArguments());
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-api

@Override
public QName getIdentifier() {
  return function.getName();
}

代码示例来源:origin: opendaylight/yangtools

@Override
public QName getIdentifier() {
  return function.getName();
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr substringBeforeExpr(final List<YangExpr> args) {
  checkArgument(args.size() == 2, "substring-before(string, string) takes two arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.SUBSTRING_BEFORE.getIdentifier(), args);
}

代码示例来源:origin: opendaylight/yangtools

@Override
public final int hashCode() {
  return Objects.hash(getName(), getArguments());
}

代码示例来源:origin: opendaylight/yangtools

private static YangExpr substringBeforeExpr(final List<YangExpr> args) {
  checkArgument(args.size() == 2, "substring-before(string, string) takes two arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.SUBSTRING_BEFORE.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-api

@Override
public final boolean equals(final @Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof YangFunctionCallExpr)) {
    return false;
  }
  final YangFunctionCallExpr other = (YangFunctionCallExpr) obj;
  return getName().equals(other.getName()) && getArguments().equals(other.getArguments());
}

代码示例来源:origin: opendaylight/yangtools

private static YangExpr stringLengthExpr(final List<YangExpr> args) {
    checkArgument(args.size() <= 1, "string(object?) takes at most one argument");
    if (args.isEmpty()) {
      return STRING_LENGTH;
    }

    // TODO: constant literal requires math support

    return YangFunctionCallExpr.of(YangFunction.STRING_LENGTH.getIdentifier(), args);
  }
}

代码示例来源:origin: opendaylight/yangtools

@Override
public final boolean equals(final @Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (!(obj instanceof YangFunctionCallExpr)) {
    return false;
  }
  final YangFunctionCallExpr other = (YangFunctionCallExpr) obj;
  return getName().equals(other.getName()) && getArguments().equals(other.getArguments());
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr normalizeSpaceExpr(final List<YangExpr> args) {
  checkArgument(args.size() <= 1, "number(object?) takes at most one argument");
  if (args.isEmpty()) {
    return NORMALIZE_SPACE;
  }
  final YangExpr arg = args.get(0);
  if (arg instanceof YangLiteralExpr) {
    // TODO: normalize value
  }
  return YangFunctionCallExpr.of(YangFunction.NORMALIZE_SPACE.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-api

@Override
  public final String toString() {
    final StringBuilder sb = new StringBuilder().append(getName()).append('(');
    final Iterator<YangExpr> it = getArguments().iterator();
    if (it.hasNext()) {
      sb.append(it.next());
      while (it.hasNext()) {
        sb.append(", ").append(it.next());
      }
    }
    return sb.append(')').toString();
  }
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr startsWithExpr(final List<YangExpr> args) {
  checkArgument(args.size() == 2, "starts-with(string, string) takes two arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.STARTS_WITH.getIdentifier(), args);
}

代码示例来源:origin: opendaylight/yangtools

@Override
  public final String toString() {
    final StringBuilder sb = new StringBuilder().append(getName()).append('(');
    final Iterator<YangExpr> it = getArguments().iterator();
    if (it.hasNext()) {
      sb.append(it.next());
      while (it.hasNext()) {
        sb.append(", ").append(it.next());
      }
    }
    return sb.append(')').toString();
  }
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr substringAfterExpr(final List<YangExpr> args) {
  checkArgument(args.size() == 2, "substring-after(string, string) takes two arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.SUBSTRING_AFTER.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr stringExpr(final List<YangExpr> args) {
  checkArgument(args.size() <= 1, "string(object?) takes at most one argument");
  if (args.isEmpty()) {
    return STRING;
  }
  final YangExpr arg = args.get(0);
  if (arg instanceof YangLiteralExpr) {
    return arg;
  }
  // TODO: handling YangNumberExpr requires math support
  return YangFunctionCallExpr.of(YangFunction.STRING.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr concatExpr(final List<YangExpr> args) {
  checkArgument(args.size() >= 2, "concat(string, string, string*) takes at least two arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.CONCAT.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr substringExpr(final List<YangExpr> args) {
  final int size = args.size();
  checkArgument(size == 2 || size == 3, "substring-(string, number, number?) takes two or three arguments");
  // TODO: constant folding
  return YangFunctionCallExpr.of(YangFunction.SUBSTRING.getIdentifier(), args);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-api

@SuppressWarnings("null")
YangBooleanConstantExpr(final @Nullable Boolean value, final YangFunction function) {
  this.value = requireNonNull(value);
  this.function = YangFunctionCallExpr.of(function.getIdentifier());
}

代码示例来源:origin: org.opendaylight.yangtools/yang-xpath-impl

private static YangExpr derivedFromExpr(final List<YangExpr> args) {
  checkArgument(args.size() == 2, "derived-from(node-set, string) takes two arguments");
  // FIXME: coerce second arg to a QName
  return YangFunctionCallExpr.of(YangFunction.DERIVED_FROM.getIdentifier(), args);
}

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