Skip to content

Commit 7aab81f

Browse files
author
Peter Kohout
committed
fix equals and hash.
1 parent fecdd63 commit 7aab81f

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
group = 'io.github.robocup-logistics'
1010
archivesBaseName = "java-sdk"
11-
version = '0.1.17.10'
11+
version = '0.1.17.11'
1212

1313
description = ""
1414

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
package com.rcll.domain;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Getter;
5-
import lombok.NoArgsConstructor;
6-
import lombok.Setter;
3+
import lombok.*;
74

85
@Getter
96
@Setter
107
@AllArgsConstructor
118
@NoArgsConstructor
9+
@EqualsAndHashCode
1210
public class MachinePosition {
1311
ZoneName zone;
1412
Integer rotation;
15-
16-
@Override
17-
public boolean equals(Object obj) {
18-
if (obj instanceof MachinePosition) {
19-
return ((MachinePosition) obj).zone.equals(this.zone) && rotation == ((MachinePosition) obj).rotation;
20-
}
21-
return false;
22-
}
2313
}

src/main/java/com/rcll/domain/ZoneName.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.rcll.domain;
22

33
import lombok.AllArgsConstructor;
4+
import lombok.EqualsAndHashCode;
45
import org.robocup_logistics.llsf_msgs.ZoneProtos;
56

67
@AllArgsConstructor
8+
@EqualsAndHashCode
79
public class ZoneName {
810
private final String rawZone;
911

@@ -30,12 +32,4 @@ public ZoneProtos.Zone toProto() {
3032
public String toString() {
3133
return this.rawZone;
3234
}
33-
34-
@Override
35-
public boolean equals(Object obj) {
36-
if (obj instanceof ZoneName) {
37-
return ((ZoneName) obj).rawZone.equals(this.rawZone);
38-
}
39-
return false;
40-
}
4135
}

0 commit comments

Comments
 (0)