本文整理了Java中hudson.model.Label.get()
方法的一些代码示例,展示了Label.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.get()
方法的具体详情如下:
包路径:hudson.model.Label
类名称:Label
方法名:get
[英]Obtains a label by its #getName().
[中]通过其#getName()获取标签。
代码示例来源:origin: org.jenkins-ci.plugins/nodelabelparameter
@Override
public Label getAssignedLabel(SubTask task) {
return Label.get(label);
}
代码示例来源:origin: jenkinsci/pipeline-utility-steps-plugin
@Override
protected List<String> run() throws Exception {
Label aLabel = Label.get(this.label);
Set<Node> nodeSet = aLabel.getNodes();
TaskListener listener = getContext().get(TaskListener.class);
assert listener != null;
PrintStream logger = listener.getLogger();
List<String> nodes = new ArrayList<>();
if (nodeSet != null && !nodeSet.isEmpty()) {
for (Node node : nodeSet) {
Computer computer = node.toComputer();
if (!includeOffline && (computer == null || computer.isOffline())) {
continue;
}
nodes.add(node.getNodeName());
}
}
if (nodes.isEmpty()) {
logger.println("Could not find any nodes with '" + label + "' label");
} else {
logger.println("Found a total of " + nodes.size() + " nodes with the '" + label + "' label");
}
return nodes;
}
代码示例来源:origin: io.jenkins.plugins/docker-slaves
@Override
public Label getAssignedLabel(SubTask task) {
return Label.get(assignedNodeName);
}
代码示例来源:origin: jenkinsci/docker-slaves-plugin
@Override
public Label getAssignedLabel(SubTask task) {
return Label.get(assignedNodeName);
}
代码示例来源:origin: jenkinsci/mesos-plugin
private static Label getLabelWithoutCustomImage(Label label, String customDockerImage) {
return Label.get(label.toString().replace(CUSTOM_IMAGE_SEPARATOR + customDockerImage, ""));
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-durable-task-step
@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")
@Override public Label getAssignedLabel() {
if (label == null) {
return null;
} else if (label.isEmpty()) {
Jenkins j = Jenkins.getInstance();
if (j == null) {
return null;
}
return j.getSelfLabel();
} else {
return Label.get(label);
}
}
代码示例来源:origin: jenkinsci/docker-slaves-plugin
@Override public Label getAssignedLabel() {
if (label == null) {
return null;
} else if (label.isEmpty()) {
Jenkins j = Jenkins.getInstance();
if (j == null) {
return null;
}
return j.getSelfLabel();
} else {
return Label.get(label);
}
}
代码示例来源:origin: io.jenkins.plugins/docker-slaves
@Override public Label getAssignedLabel() {
if (label == null) {
return null;
} else if (label.isEmpty()) {
Jenkins j = Jenkins.getInstance();
if (j == null) {
return null;
}
return j.getSelfLabel();
} else {
return Label.get(label);
}
}
内容来源于网络,如有侵权,请联系作者删除!