1717package org .neo4j .driver .internal .summary ;
1818
1919import java .util .Arrays ;
20- import java .util .Map ;
21- import java .util .Objects ;
2220import java .util .Optional ;
2321import org .neo4j .driver .NotificationCategory ;
2422import org .neo4j .driver .NotificationClassification ;
2523import org .neo4j .driver .NotificationSeverity ;
26- import org .neo4j .driver .Value ;
2724import org .neo4j .driver .summary .InputPosition ;
2825import org .neo4j .driver .summary .Notification ;
2926
30- public class InternalNotification extends InternalGqlStatusObject implements Notification {
27+ public class InternalNotification implements Notification {
3128 public static Optional <NotificationCategory > valueOf (String value ) {
3229 return Arrays .stream (NotificationClassification .values ())
3330 .filter (type -> type .toString ().equals (value ))
@@ -50,52 +47,44 @@ public static Optional<NotificationCategory> valueOf(String value) {
5047 private final String description ;
5148 private final NotificationSeverity severityLevel ;
5249 private final String rawSeverityLevel ;
53- private final NotificationClassification classification ;
54- private final String rawClassification ;
50+ private final NotificationCategory category ;
51+ private final String rawCategory ;
5552 private final InputPosition position ;
5653
5754 public InternalNotification (
58- String gqlStatus ,
59- String statusDescription ,
60- Map <String , Value > diagnosticRecord ,
6155 String code ,
6256 String title ,
6357 String description ,
6458 NotificationSeverity severityLevel ,
6559 String rawSeverityLevel ,
66- NotificationClassification classification ,
67- String rawClassification ,
60+ NotificationCategory category ,
61+ String rawCategory ,
6862 InputPosition position ) {
69- super (gqlStatus , statusDescription , diagnosticRecord );
70- this .code = Objects .requireNonNull (code );
63+ this .code = code ;
7164 this .title = title ;
7265 this .description = description ;
7366 this .severityLevel = severityLevel ;
7467 this .rawSeverityLevel = rawSeverityLevel ;
75- this .classification = classification ;
76- this .rawClassification = rawClassification ;
68+ this .category = category ;
69+ this .rawCategory = rawCategory ;
7770 this .position = position ;
7871 }
7972
80- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
8173 @ Override
8274 public String code () {
8375 return code ;
8476 }
8577
86- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
8778 @ Override
8879 public String title () {
8980 return title ;
9081 }
9182
92- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
9383 @ Override
9484 public String description () {
9585 return description ;
9686 }
9787
98- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
9988 @ Override
10089 public InputPosition position () {
10190 return position ;
@@ -111,62 +100,21 @@ public Optional<String> rawSeverityLevel() {
111100 return Optional .ofNullable (rawSeverityLevel );
112101 }
113102
114- @ Override
115- public Optional <NotificationClassification > classification () {
116- return Optional .ofNullable (classification );
117- }
118-
119- @ Override
120- public Optional <String > rawClassification () {
121- return Optional .ofNullable (rawClassification );
122- }
123-
124103 @ Override
125104 public Optional <NotificationCategory > category () {
126- return Optional .ofNullable (classification );
105+ return Optional .ofNullable (category );
127106 }
128107
129108 @ Override
130109 public Optional <String > rawCategory () {
131- return Optional .ofNullable (rawClassification );
132- }
133-
134- @ Override
135- public boolean equals (Object o ) {
136- if (this == o ) return true ;
137- if (o == null || getClass () != o .getClass ()) return false ;
138- if (!super .equals (o )) return false ;
139- var that = (InternalNotification ) o ;
140- return Objects .equals (code , that .code )
141- && Objects .equals (title , that .title )
142- && Objects .equals (description , that .description )
143- && Objects .equals (severityLevel , that .severityLevel )
144- && Objects .equals (rawSeverityLevel , that .rawSeverityLevel )
145- && classification == that .classification
146- && Objects .equals (rawClassification , that .rawClassification )
147- && Objects .equals (position , that .position );
148- }
149-
150- @ Override
151- public int hashCode () {
152- return Objects .hash (
153- super .hashCode (),
154- code ,
155- title ,
156- description ,
157- severityLevel ,
158- rawSeverityLevel ,
159- classification ,
160- rawClassification ,
161- position );
110+ return Optional .ofNullable (rawCategory );
162111 }
163112
164113 @ Override
165114 public String toString () {
166115 var info = "code=" + code + ", title=" + title + ", description=" + description + ", severityLevel="
167- + severityLevel + ", rawSeverityLevel=" + rawSeverityLevel + ", classification=" + classification
168- + ", rawClassification="
169- + rawClassification ;
116+ + severityLevel + ", rawSeverityLevel=" + rawSeverityLevel + ", category=" + category + ", rawCategory="
117+ + rawCategory ;
170118 return position == null ? info : info + ", position={" + position + "}" ;
171119 }
172120}
0 commit comments