More meaningful toString() method

Produce toString without dilligently adding it to every single class.
Rely on heuristics to cut down the number of fields to show.
This commit is contained in:
Kohsuke Kawaguchi
2016-06-02 22:36:47 -07:00
parent 3c5592c1c8
commit cde501af8d
6 changed files with 72 additions and 11 deletions

View File

@@ -77,6 +77,7 @@ public class GHRepository extends GHObject {
private String default_branch,language;
private Map<String,GHCommit> commits = new HashMap<String, GHCommit>();
@SkipFromToString
private GHRepoPermission permissions;
private GHRepository source, parent;
@@ -1350,14 +1351,9 @@ public class GHRepository extends GHObject {
}
@Override
public String toString() {
return "Repository:"+owner.login+":"+name;
}
@Override
public int hashCode() {
return toString().hashCode();
return ("Repository:"+owner.login+":"+name).hashCode();
}
@Override