@Override public boolean matches(VariableResolver<Boolean> resolver) { return base.matches(resolver); }
@Override public boolean matches(VariableResolver<Boolean> resolver) { return !base.matches(resolver); }
/** * 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; } }); }
@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); }
public final boolean matches(Node n) { return matches(n.getAssignedLabels()); }
/** * 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); }
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++;
@Override public boolean matches(VariableResolver<Boolean> resolver) { return !base.matches(resolver); }
@Override public boolean matches(VariableResolver<Boolean> resolver) { return !base.matches(resolver); }
@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); }
public boolean match(Node node) { if (node == null) return false; try { return Label.parseExpression(labelExpr).matches(node); } catch (ANTLRException e) { } return false; }
/** * 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; }
@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; } }
public Boolean call() throws ANTLRException { Node n = Jenkins.getInstance().getNode(nodeName); if (n == null) return false; return Label.parseExpression(labelExpr).matches(n); }