File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
management-api-server/src/main/java/com/datastax/mgmtapi/resources/models Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import com .fasterxml .jackson .annotation .JsonCreator ;
9
9
import com .fasterxml .jackson .annotation .JsonProperty ;
10
+ import com .fasterxml .jackson .core .JsonProcessingException ;
11
+ import com .fasterxml .jackson .databind .ObjectMapper ;
10
12
import java .util .Map ;
13
+ import java .util .Objects ;
11
14
12
15
public class Table {
13
16
@ JsonProperty (value = "name" , required = true )
@@ -23,4 +26,30 @@ public Table(
23
26
this .name = name ;
24
27
this .compaction = compaction ;
25
28
}
29
+
30
+ @ Override
31
+ public boolean equals (Object o ) {
32
+ if (this == o ) {
33
+ return true ;
34
+ }
35
+ if (o == null || getClass () != o .getClass ()) {
36
+ return false ;
37
+ }
38
+ Table table = (Table ) o ;
39
+ return Objects .equals (name , table .name ) && Objects .equals (compaction , table .compaction );
40
+ }
41
+
42
+ @ Override
43
+ public int hashCode () {
44
+ return Objects .hash (name , compaction );
45
+ }
46
+
47
+ @ Override
48
+ public String toString () {
49
+ try {
50
+ return new ObjectMapper ().writeValueAsString (this );
51
+ } catch (JsonProcessingException je ) {
52
+ return String .format ("Unable to format table (%s)" , je .getMessage ());
53
+ }
54
+ }
26
55
}
You can’t perform that action at this time.
0 commit comments