hudson.model.Label.matches()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(127)

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

Label.matches介绍

[英]Evaluates whether the current label name is equal to the name parameter.
[中]计算当前标签名称是否等于name参数。

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return base.matches(resolver);
}

代码示例来源:origin: jenkinsci/jenkins

@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return !base.matches(resolver);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Evaluates whether the label expression is true when an entity owns the given set of
 * {@link LabelAtom}s.
 */
public final boolean matches(final Collection<LabelAtom> labels) {
  return matches(new VariableResolver<Boolean>() {
    public Boolean resolve(String name) {
      for (LabelAtom a : labels)
        if (a.getName().equals(name))
          return true;
      return false;
    }
  });
}

代码示例来源:origin: jenkinsci/jenkins

@Override
public final boolean equals(Object that) {
  if (this == that) return true;
  if (that == null || getClass() != that.getClass()) return false;
  return matches(((Label)that).name);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver),rhs.matches(resolver));
}

代码示例来源:origin: jenkinsci/jenkins

public final boolean matches(Node n) {
  return matches(n.getAssignedLabels());
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Gets all {@link Node}s that belong to this label.
 */
@Exported
public Set<Node> getNodes() {
  Set<Node> nodes = this.nodes;
  if(nodes!=null) return nodes;
  Set<Node> r = new HashSet<>();
  Jenkins h = Jenkins.getInstance();
  if(this.matches(h))
    r.add(h);
  for (Node n : h.getNodes()) {
    if(this.matches(n))
      r.add(n);
  }
  return this.nodes = Collections.unmodifiableSet(r);
}

代码示例来源:origin: jenkinsci/jenkins

if (topLevelItem instanceof AbstractProject) {
  final AbstractProject project = (AbstractProject) topLevelItem;
  if (matches(project.getAssignedLabelString())) {
    result++;
      if (i instanceof AbstractProject) {
        final AbstractProject project = (AbstractProject) i;
        if (matches(project.getAssignedLabelString())) {
          result++;

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return !base.matches(resolver);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return !base.matches(resolver);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver), rhs.matches(resolver));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver),rhs.matches(resolver));
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver),rhs.matches(resolver));
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
public final boolean equals(Object that) {
  if (this == that) return true;
  if (that == null || getClass() != that.getClass()) return false;
  return matches(((Label)that).name);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver),rhs.matches(resolver));
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Note that we evaluate both branches of the expression all the time.
 * That is, it behaves like "a|b" not "a||b"
 */
@Override
public boolean matches(VariableResolver<Boolean> resolver) {
  return op(lhs.matches(resolver),rhs.matches(resolver));
}

代码示例来源:origin: jenkinsci/selenium-plugin

public boolean match(Node node) {
  if (node == null)
    return false;
  try {
    return Label.parseExpression(labelExpr).matches(node);
  } catch (ANTLRException e) {
  }
  return false;
}

代码示例来源:origin: jenkinsci/jclouds-plugin

/**
 * Gets {@link jenkins.plugins.jclouds.compute.JCloudsSlaveTemplate} that has the matching {@link Label}.
 * @param label The label to be matched.
 * @return The slave template or {@code null} if the specified label did not match.
 */
public JCloudsSlaveTemplate getTemplate(Label label) {
  for (JCloudsSlaveTemplate t : templates)
    if (label == null || label.matches(t.getLabelSet()))
      return t;
  return null;
}

代码示例来源:origin: carlossg/jenkins-kubernetes-plugin

@Override
  protected PodTemplate transform(@Nonnull KubernetesCloud cloud, @Nonnull PodTemplate podTemplate, @CheckForNull Label label) {
    if ((label == null && podTemplate.getNodeUsageMode() == Node.Mode.NORMAL) || (label != null && label.matches(podTemplate.getLabelSet()))) {
      return podTemplate;
    }
    return null;
  }
}

代码示例来源:origin: jenkinsci/selenium-plugin

public Boolean call() throws ANTLRException {
  Node n = Jenkins.getInstance().getNode(nodeName);
  if (n == null)
    return false;
  return Label.parseExpression(labelExpr).matches(n);
}

相关文章