Skip to content

Commit d318b5d

Browse files
committed
feat: create and update toString on cloud provider
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent 3f7d37d commit d318b5d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/org/soujava/demos/arangodb/document/CloudProvider.java

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import jakarta.nosql.*;
55

6+
import java.util.Objects;
7+
68
@Entity
79
@Inheritance
810
@DiscriminatorColumn("type")
@@ -15,4 +17,17 @@ public class CloudProvider {
1517
protected String region;
1618

1719

20+
@Override
21+
public boolean equals(Object o) {
22+
if (o == null || getClass() != o.getClass()) {
23+
return false;
24+
}
25+
CloudProvider that = (CloudProvider) o;
26+
return Objects.equals(id, that.id);
27+
}
28+
29+
@Override
30+
public int hashCode() {
31+
return Objects.hashCode(id);
32+
}
1833
}

0 commit comments

Comments
 (0)