Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sprachschulsystem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Pokorný
Sprachschulsystem
Commits
4a131daf
There was an error fetching the commit references. Please try again later.
Commit
4a131daf
authored
2 years ago
by
Martin Gargalovič
Browse files
Options
Downloads
Patches
Plain Diff
added hash and equals overide
parent
1f1240f8
No related branches found
No related tags found
3 merge requests
!31
M2
,
!28
M2 user
,
!27
Draft: M2 user
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/model/src/main/java/org/fuseri/model/dto/exercise/ExerciseDto.java
+24
-0
24 additions, 0 deletions
.../main/java/org/fuseri/model/dto/exercise/ExerciseDto.java
with
24 additions
and
0 deletions
application/model/src/main/java/org/fuseri/model/dto/exercise/ExerciseDto.java
+
24
−
0
View file @
4a131daf
...
@@ -7,6 +7,8 @@ import lombok.Getter;
...
@@ -7,6 +7,8 @@ import lombok.Getter;
import
lombok.Setter
;
import
lombok.Setter
;
import
org.fuseri.model.dto.common.DomainObjectDto
;
import
org.fuseri.model.dto.common.DomainObjectDto
;
import
java.util.Objects
;
@Getter
@Getter
@Setter
@Setter
public
class
ExerciseDto
extends
DomainObjectDto
{
public
class
ExerciseDto
extends
DomainObjectDto
{
...
@@ -23,4 +25,26 @@ public class ExerciseDto extends DomainObjectDto {
...
@@ -23,4 +25,26 @@ public class ExerciseDto extends DomainObjectDto {
@NotBlank
@NotBlank
private
String
courseId
;
private
String
courseId
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
ExerciseDto
that
=
(
ExerciseDto
)
o
;
if
(
difficulty
!=
that
.
difficulty
)
return
false
;
if
(!
Objects
.
equals
(
name
,
that
.
name
))
return
false
;
if
(!
Objects
.
equals
(
description
,
that
.
description
))
return
false
;
return
Objects
.
equals
(
courseId
,
that
.
courseId
);
}
@Override
public
int
hashCode
()
{
int
result
=
name
!=
null
?
name
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
difficulty
;
result
=
31
*
result
+
(
courseId
!=
null
?
courseId
.
hashCode
()
:
0
);
return
result
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment