Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
9d1b383a
Commit
9d1b383a
authored
Apr 25, 2019
by
Greg Messner
Browse files
Added hashcode() and equals() implementations.
parent
1a457e1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GitLabApiException.java
View file @
9d1b383a
...
@@ -170,4 +170,59 @@ public class GitLabApiException extends Exception {
...
@@ -170,4 +170,59 @@ public class GitLabApiException extends Exception {
public
Map
<
String
,
List
<
String
>>
getValidationErrors
()
{
public
Map
<
String
,
List
<
String
>>
getValidationErrors
()
{
return
(
validationErrors
);
return
(
validationErrors
);
}
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
httpStatus
;
result
=
prime
*
result
+
((
message
==
null
)
?
0
:
message
.
hashCode
());
result
=
prime
*
result
+
((
statusInfo
==
null
)
?
0
:
statusInfo
.
hashCode
());
result
=
prime
*
result
+
((
validationErrors
==
null
)
?
0
:
validationErrors
.
hashCode
());
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
GitLabApiException
other
=
(
GitLabApiException
)
obj
;
if
(
httpStatus
!=
other
.
httpStatus
)
{
return
false
;
}
if
(
message
==
null
)
{
if
(
other
.
message
!=
null
)
return
false
;
}
else
if
(!
message
.
equals
(
other
.
message
))
{
return
false
;
}
if
(
statusInfo
==
null
)
{
if
(
other
.
statusInfo
!=
null
)
return
false
;
}
else
if
(!
statusInfo
.
equals
(
other
.
statusInfo
))
{
return
false
;
}
if
(
validationErrors
==
null
)
{
if
(
other
.
validationErrors
!=
null
)
return
false
;
}
else
if
(!
validationErrors
.
equals
(
other
.
validationErrors
))
{
return
false
;
}
return
true
;
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment