MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / Abc

Class Abc

Java/OverridingEqualsMethod/Abc.java:1–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1public class Abc {
2
3 public String getString() {
4 return string;
5 }
6
7 public int getValue() {
8 return value;
9 }
10
11 private String string;
12 private int value;
13
14 public Abc(String string, int value) {
15 this.string = string;
16 this.value = value;
17 }
18
19 @Override
20 public boolean equals(Object object) {
21 if (object == this) {
22 return true;
23 }
24 if (!(object instanceof Abc)) {
25 return false;
26 }
27 Abc abc = (Abc) object;
28 return string.equals(abc.getString()) && value == abc.getValue();
29 }
30
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected