17
17
package org .neo4j .driver .internal .summary ;
18
18
19
19
import java .util .Map ;
20
+ import java .util .Objects ;
20
21
import java .util .Optional ;
21
22
import org .neo4j .driver .NotificationClassification ;
22
23
import org .neo4j .driver .NotificationSeverity ;
@@ -31,6 +32,11 @@ public final class InternalGqlNotification extends InternalGqlStatusObject imple
31
32
private final NotificationClassification classification ;
32
33
private final String rawClassification ;
33
34
35
+ // private Neo4j use only
36
+ private final String code ;
37
+ private final String title ;
38
+ private final String description ;
39
+
34
40
public InternalGqlNotification (
35
41
String gqlStatus ,
36
42
String statusDescription ,
@@ -39,13 +45,19 @@ public InternalGqlNotification(
39
45
NotificationSeverity severityLevel ,
40
46
String rawSeverityLevel ,
41
47
NotificationClassification classification ,
42
- String rawClassification ) {
48
+ String rawClassification ,
49
+ String code ,
50
+ String title ,
51
+ String description ) {
43
52
super (gqlStatus , statusDescription , diagnosticRecord );
44
53
this .position = position ;
45
54
this .severityLevel = severityLevel ;
46
55
this .rawSeverityLevel = rawSeverityLevel ;
47
56
this .classification = classification ;
48
57
this .rawClassification = rawClassification ;
58
+ this .code = code ;
59
+ this .title = title ;
60
+ this .description = description ;
49
61
}
50
62
51
63
@ Override
@@ -73,11 +85,47 @@ public Optional<String> rawClassification() {
73
85
return Optional .ofNullable (rawClassification );
74
86
}
75
87
88
+ @ Override
89
+ public boolean equals (Object o ) {
90
+ if (this == o ) return true ;
91
+ if (o == null || getClass () != o .getClass ()) return false ;
92
+ var that = (InternalGqlNotification ) o ;
93
+ return Objects .equals (gqlStatus , that .gqlStatus )
94
+ && Objects .equals (statusDescription , that .statusDescription )
95
+ && Objects .equals (diagnosticRecord , that .diagnosticRecord )
96
+ && Objects .equals (code , that .code )
97
+ && Objects .equals (title , that .title )
98
+ && Objects .equals (description , that .description );
99
+ }
100
+
101
+ @ Override
102
+ public int hashCode () {
103
+ return Objects .hash (gqlStatus , statusDescription , diagnosticRecord , code , title , description );
104
+ }
105
+
76
106
@ Override
77
107
public String toString () {
78
108
return "InternalGqlNotification{" + "gqlStatus='"
79
109
+ gqlStatus + '\'' + ", statusDescription='"
80
110
+ statusDescription + '\'' + ", diagnosticRecord="
81
- + diagnosticRecord + '}' ;
111
+ + diagnosticRecord + '\'' + ", code='"
112
+ + code + '\'' + ", title='"
113
+ + title + '\'' + ", description='"
114
+ + description + '}' ;
115
+ }
116
+
117
+ // private Neo4j use only
118
+ public String code () {
119
+ return code ;
120
+ }
121
+
122
+ // private Neo4j use only
123
+ public String title () {
124
+ return title ;
125
+ }
126
+
127
+ // private Neo4j use only
128
+ public String description () {
129
+ return description ;
82
130
}
83
131
}
0 commit comments