File tree 3 files changed +28
-3
lines changed
src/main/java/org/scm4j/commons/coords
3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1
- package org .scm4j .commons ;
1
+ package org .scm4j .commons .coords ;
2
+
3
+ import org .scm4j .commons .Version ;
2
4
3
5
public interface Coords {
4
6
Original file line number Diff line number Diff line change 2
2
3
3
import org .apache .commons .lang3 .StringUtils ;
4
4
import org .scm4j .commons .CommentedString ;
5
- import org .scm4j .commons .Coords ;
6
5
import org .scm4j .commons .Version ;
7
6
8
7
public class CoordsGradle implements Coords {
Original file line number Diff line number Diff line change 2
2
3
3
import org .apache .commons .lang3 .StringUtils ;
4
4
import org .scm4j .commons .CommentedString ;
5
- import org .scm4j .commons .Coords ;
6
5
import org .scm4j .commons .Version ;
7
6
8
7
public class CoordsMaven implements Coords {
@@ -93,4 +92,29 @@ public Version getVersion() {
93
92
public String getName () {
94
93
return groupId + artifactId ;
95
94
}
95
+
96
+ @ Override
97
+ public int hashCode () {
98
+ final int prime = 31 ;
99
+ int result = 1 ;
100
+ result = prime * result + ((coordsStringNoComment == null ) ? 0 : coordsStringNoComment .hashCode ());
101
+ return result ;
102
+ }
103
+
104
+ @ Override
105
+ public boolean equals (Object obj ) {
106
+ if (this == obj )
107
+ return true ;
108
+ if (obj == null )
109
+ return false ;
110
+ if (getClass () != obj .getClass ())
111
+ return false ;
112
+ CoordsMaven other = (CoordsMaven ) obj ;
113
+ if (coordsStringNoComment == null ) {
114
+ if (other .coordsStringNoComment != null )
115
+ return false ;
116
+ } else if (!coordsStringNoComment .equals (other .coordsStringNoComment ))
117
+ return false ;
118
+ return true ;
119
+ }
96
120
}
You can’t perform that action at this time.
0 commit comments