Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
15c44c70
Commit
15c44c70
authored
4 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add hashCode and equals method
parent
9a99025b
No related branches found
No related tags found
1 merge request
!27
Resolve "Add equals/hash methods for serializable classes"
Pipeline
#727
passed with warnings
4 years ago
Stage: build
Stage: test
Stage: check
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java
+20
-0
20 additions, 0 deletions
...in/java/theodolite/uc4/streamprocessing/HourOfDayKey.java
with
20 additions
and
0 deletions
uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java
+
20
−
0
View file @
15c44c70
package
theodolite.uc4.streamprocessing
;
package
theodolite.uc4.streamprocessing
;
import
java.util.Objects
;
/**
/**
* Composed key of an hour of the day and a sensor id.
* Composed key of an hour of the day and a sensor id.
*/
*/
...
@@ -26,4 +28,22 @@ public class HourOfDayKey {
...
@@ -26,4 +28,22 @@ public class HourOfDayKey {
return
this
.
sensorId
+
";"
+
this
.
hourOfDay
;
return
this
.
sensorId
+
";"
+
this
.
hourOfDay
;
}
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
this
.
hourOfDay
,
this
.
sensorId
);
}
@Override
public
boolean
equals
(
final
Object
obj
)
{
if
(
obj
==
this
)
{
return
true
;
}
if
(
obj
instanceof
HourOfDayKey
)
{
final
HourOfDayKey
other
=
(
HourOfDayKey
)
obj
;
return
Objects
.
equals
(
this
.
hourOfDay
,
other
.
hourOfDay
)
&&
Objects
.
equals
(
this
.
sensorId
,
other
.
sensorId
);
}
return
false
;
}
}
}
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