@Override public boolean matches(File file) { return file.isFile() && Objects.equal(JENKINSFILE, file.getName()); } };
/** * Returns true if this change matches the given artifact key */ public boolean matches(MavenArtifactKey artifactKey) { return Objects.equal(this.dependency, artifactKey.toString()); }
@Override public boolean accept(File file) { return Objects.equal(extension, Files.getExtension(file.getName())); } }
public static boolean hasLabel(Collection<GHLabel> labels, String label) { if (labels != null) { for (GHLabel ghLabel : labels) { if (Objects.equal(label, ghLabel.getName())) { return true; } } } return false; }
public static Container findContainer(List<Container> containers, String name) { for (Container container : containers) { if (Objects.equal(container.getName(), name)) { return container; } } return null; }
public static boolean hasLabel(Collection<GHLabel> labels, String label) { if (labels != null) { for (GHLabel ghLabel : labels) { if (Objects.equal(label, ghLabel.getName())) { return true; } } } return false; }
public GitRepositoryConfig findRepository(String name) { for (GitRepositoryConfig repository : repositories) { if (Objects.equal(name, repository.getName())) { return repository; } } return null; } }
/** * Returns the change for the given name or null if there is none */ public Change change(String name) { for (Change change : changes) { if (Objects.equal(name, change.getName())) { return change; } } return null; }
public GithubOrganisation findOrganisation(String name) { if (organisations != null) { for (GithubOrganisation organisation : organisations) { if (Objects.equal(name, organisation.getName())) { return organisation; } } } return null; }
public GithubOrganisation findOrganisation(String name) { if (organisations != null) { for (GithubOrganisation organisation : organisations) { if (Objects.equal(name, organisation.getName())) { return organisation; } } } return null; }
public GitRepositoryConfig findRepository(String name) { for (GitRepositoryConfig repository : repositories) { if (Objects.equal(name, repository.getName())) { return repository; } } return null; } }
private String conflictedDependencyText() { List<String> messages = new ArrayList<>(); for (Map.Entry<String, List<DependencyLink>> entry : versions.entrySet()) { String key = entry.getKey(); if (!Objects.equal(version, key)) { List<DependencyLink> dependencies = entry.getValue(); String dependencyNames = dependencies.stream().map(link -> link.getParent().toString()).collect(Collectors.joining(", ")); messages.add(dependencyNames + " => " + key); } } return String.join(", ", messages); }
private String conflictedDependencyText() { List<String> messages = new ArrayList<>(); for (Map.Entry<String, List<DependencyLink>> entry : versions.entrySet()) { String key = entry.getKey(); if (!Objects.equal(version, key)) { List<DependencyLink> dependencies = entry.getValue(); String dependencyNames = dependencies.stream().map(link -> link.getParent().toString()).collect(Collectors.joining(", ")); messages.add(dependencyNames + " => " + key); } } return String.join(", ", messages); }
public static List<Element> findElementsWithName(Element rootElement, String elementName) { List<Element> answer = new ArrayList<>(); List<Element> children = rootElement.getChildren(); for (Element child : children) { if (Objects.equal(elementName, child.getName())) { answer.add(child); } else { answer.addAll(findElementsWithName(child, elementName)); } } return answer; }
public static List<Element> findElementsWithName(Element rootElement, String elementName) { List<Element> answer = new ArrayList<>(); List<Element> children = rootElement.getChildren(); for (Element child : children) { if (Objects.equal(elementName, child.getName())) { answer.add(child); } else { answer.addAll(findElementsWithName(child, elementName)); } } return answer; }
protected <T extends HasMetadata> T findNamed(List<T> items, String name) { for (T item : items) { ObjectMeta metadata = item.getMetadata(); if (metadata != null) { String aName = metadata.getName(); if (Objects.equal(name, aName)) { return item; } } } return null; }