Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc2da22

Browse filesBrowse files
committed
added value equality
1 parent 2df450c commit bc2da22
Copy full SHA for bc2da22

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,5 +371,20 @@ public String toString() {
371371
return "Repository:"+owner+":"+name;
372372
}
373373

374+
@Override
375+
public int hashCode() {
376+
return toString().hashCode();
377+
}
378+
379+
@Override
380+
public boolean equals(Object obj) {
381+
if (obj instanceof GHRepository) {
382+
GHRepository that = (GHRepository) obj;
383+
return this.owner.equals(that.owner)
384+
&& this.name.equals(that.name);
385+
}
386+
return false;
387+
}
388+
374389
private static final String TIME_FORMAT = "yyyy/MM/dd HH:mm:ss ZZZZ";
375390
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.