1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.internal.storage.dfs;
12
13
14
15
16 public class DfsRepositoryDescription {
17 private final String repositoryName;
18
19
20
21
22 public DfsRepositoryDescription() {
23 this(null);
24 }
25
26
27
28
29
30
31
32 public DfsRepositoryDescription(String repositoryName) {
33 this.repositoryName = repositoryName;
34 }
35
36
37
38
39
40
41 public String getRepositoryName() {
42 return repositoryName;
43 }
44
45
46 @Override
47 public int hashCode() {
48 if (getRepositoryName() != null)
49 return getRepositoryName().hashCode();
50 return System.identityHashCode(this);
51 }
52
53
54 @Override
55 public boolean equals(Object b) {
56 if (b instanceof DfsRepositoryDescription){
57 String name = getRepositoryName();
58 String otherName = ((DfsRepositoryDescription) b).getRepositoryName();
59 return name != null ? name.equals(otherName) : this == b;
60 }
61 return false;
62 }
63
64
65 @SuppressWarnings("nls")
66 @Override
67 public String toString() {
68 return "DfsRepositoryDescription[" + getRepositoryName() + "]";
69 }
70 }