io.fabric8.utils.Objects.equal()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(121)

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

Objects.equal介绍

暂无

代码示例

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. /**
  2. * Returns true if this and that object have the same underlying status
  3. */
  4. public boolean equalStatus(StatusInfo that) {
  5. return Objects.equal(this.status, that.status) &&
  6. Objects.equal(this.issueState, that.issueState) &&
  7. Objects.equal(this.pullRequestState, that.pullRequestState);
  8. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. /**
  2. * Returns true if the given change is for the same kind and dependency
  3. */
  4. public boolean matches(DependencyVersionChange that) {
  5. return Objects.equal(this.kind, that.kind) && Objects.equal(this.dependency, that.dependency);
  6. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. /**
  2. * Returns true if this and that object have the same underlying status
  3. */
  4. public boolean equalStatus(StatusInfo that) {
  5. return Objects.equal(this.status, that.status) &&
  6. Objects.equal(this.issueState, that.issueState) &&
  7. Objects.equal(this.pullRequestState, that.pullRequestState);
  8. }

代码示例来源:origin: io.fabric8.jube/core

  1. public boolean match(File file) {
  2. String name = file.getName();
  3. String extension = Files.getFileExtension(name);
  4. return Objects.equal(name, "launcher") || Objects.equal(extension, "sh") || Objects.equal(extension, "bat") || Objects.equal(extension, "cmd");
  5. }

代码示例来源:origin: io.fabric8.forge/devops

  1. @Override
  2. public boolean matches(File file) {
  3. return file.isFile() && Objects.equal(JENKINSFILE, file.getName());
  4. }
  5. };

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. /**
  2. * Returns true if this change matches the given artifact key
  3. */
  4. public boolean matches(MavenArtifactKey artifactKey) {
  5. return Objects.equal(this.dependency, artifactKey.toString());
  6. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. @Override
  2. public boolean accept(File file) {
  3. return Objects.equal(extension, Files.getExtension(file.getName()));
  4. }
  5. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. public static boolean hasLabel(Collection<GHLabel> labels, String label) {
  2. if (labels != null) {
  3. for (GHLabel ghLabel : labels) {
  4. if (Objects.equal(label, ghLabel.getName())) {
  5. return true;
  6. }
  7. }
  8. }
  9. return false;
  10. }

代码示例来源:origin: fabric8io/jube

  1. public static Container findContainer(List<Container> containers, String name) {
  2. for (Container container : containers) {
  3. if (Objects.equal(container.getName(), name)) {
  4. return container;
  5. }
  6. }
  7. return null;
  8. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. public static boolean hasLabel(Collection<GHLabel> labels, String label) {
  2. if (labels != null) {
  3. for (GHLabel ghLabel : labels) {
  4. if (Objects.equal(label, ghLabel.getName())) {
  5. return true;
  6. }
  7. }
  8. }
  9. return false;
  10. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. public GitRepositoryConfig findRepository(String name) {
  2. for (GitRepositoryConfig repository : repositories) {
  3. if (Objects.equal(name, repository.getName())) {
  4. return repository;
  5. }
  6. }
  7. return null;
  8. }
  9. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. /**
  2. * Returns the change for the given name or null if there is none
  3. */
  4. public Change change(String name) {
  5. for (Change change : changes) {
  6. if (Objects.equal(name, change.getName())) {
  7. return change;
  8. }
  9. }
  10. return null;
  11. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. public GithubOrganisation findOrganisation(String name) {
  2. if (organisations != null) {
  3. for (GithubOrganisation organisation : organisations) {
  4. if (Objects.equal(name, organisation.getName())) {
  5. return organisation;
  6. }
  7. }
  8. }
  9. return null;
  10. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. public GithubOrganisation findOrganisation(String name) {
  2. if (organisations != null) {
  3. for (GithubOrganisation organisation : organisations) {
  4. if (Objects.equal(name, organisation.getName())) {
  5. return organisation;
  6. }
  7. }
  8. }
  9. return null;
  10. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. public GitRepositoryConfig findRepository(String name) {
  2. for (GitRepositoryConfig repository : repositories) {
  3. if (Objects.equal(name, repository.getName())) {
  4. return repository;
  5. }
  6. }
  7. return null;
  8. }
  9. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. private String conflictedDependencyText() {
  2. List<String> messages = new ArrayList<>();
  3. for (Map.Entry<String, List<DependencyLink>> entry : versions.entrySet()) {
  4. String key = entry.getKey();
  5. if (!Objects.equal(version, key)) {
  6. List<DependencyLink> dependencies = entry.getValue();
  7. String dependencyNames = dependencies.stream().map(link -> link.getParent().toString()).collect(Collectors.joining(", "));
  8. messages.add(dependencyNames + " => " + key);
  9. }
  10. }
  11. return String.join(", ", messages);
  12. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. private String conflictedDependencyText() {
  2. List<String> messages = new ArrayList<>();
  3. for (Map.Entry<String, List<DependencyLink>> entry : versions.entrySet()) {
  4. String key = entry.getKey();
  5. if (!Objects.equal(version, key)) {
  6. List<DependencyLink> dependencies = entry.getValue();
  7. String dependencyNames = dependencies.stream().map(link -> link.getParent().toString()).collect(Collectors.joining(", "));
  8. messages.add(dependencyNames + " => " + key);
  9. }
  10. }
  11. return String.join(", ", messages);
  12. }

代码示例来源:origin: io.fabric8.updatebot/updatebot-core

  1. public static List<Element> findElementsWithName(Element rootElement, String elementName) {
  2. List<Element> answer = new ArrayList<>();
  3. List<Element> children = rootElement.getChildren();
  4. for (Element child : children) {
  5. if (Objects.equal(elementName, child.getName())) {
  6. answer.add(child);
  7. } else {
  8. answer.addAll(findElementsWithName(child, elementName));
  9. }
  10. }
  11. return answer;
  12. }

代码示例来源:origin: io.jenkins.updatebot/updatebot-core

  1. public static List<Element> findElementsWithName(Element rootElement, String elementName) {
  2. List<Element> answer = new ArrayList<>();
  3. List<Element> children = rootElement.getChildren();
  4. for (Element child : children) {
  5. if (Objects.equal(elementName, child.getName())) {
  6. answer.add(child);
  7. } else {
  8. answer.addAll(findElementsWithName(child, elementName));
  9. }
  10. }
  11. return answer;
  12. }

代码示例来源:origin: io.fabric8.devops.apps/templates

  1. protected <T extends HasMetadata> T findNamed(List<T> items, String name) {
  2. for (T item : items) {
  3. ObjectMeta metadata = item.getMetadata();
  4. if (metadata != null) {
  5. String aName = metadata.getName();
  6. if (Objects.equal(name, aName)) {
  7. return item;
  8. }
  9. }
  10. }
  11. return null;
  12. }

相关文章