17
17
package org .neo4j .driver .internal .summary ;
18
18
19
19
import java .util .Arrays ;
20
- import java .util .Map ;
21
- import java .util .Objects ;
22
20
import java .util .Optional ;
23
21
import org .neo4j .driver .NotificationCategory ;
24
22
import org .neo4j .driver .NotificationClassification ;
25
23
import org .neo4j .driver .NotificationSeverity ;
26
- import org .neo4j .driver .Value ;
27
24
import org .neo4j .driver .summary .InputPosition ;
28
25
import org .neo4j .driver .summary .Notification ;
29
26
30
- public class InternalNotification extends InternalGqlStatusObject implements Notification {
27
+ public class InternalNotification implements Notification {
31
28
public static Optional <NotificationCategory > valueOf (String value ) {
32
29
return Arrays .stream (NotificationClassification .values ())
33
30
.filter (type -> type .toString ().equals (value ))
@@ -50,52 +47,44 @@ public static Optional<NotificationCategory> valueOf(String value) {
50
47
private final String description ;
51
48
private final NotificationSeverity severityLevel ;
52
49
private final String rawSeverityLevel ;
53
- private final NotificationClassification classification ;
54
- private final String rawClassification ;
50
+ private final NotificationCategory category ;
51
+ private final String rawCategory ;
55
52
private final InputPosition position ;
56
53
57
54
public InternalNotification (
58
- String gqlStatus ,
59
- String statusDescription ,
60
- Map <String , Value > diagnosticRecord ,
61
55
String code ,
62
56
String title ,
63
57
String description ,
64
58
NotificationSeverity severityLevel ,
65
59
String rawSeverityLevel ,
66
- NotificationClassification classification ,
67
- String rawClassification ,
60
+ NotificationCategory category ,
61
+ String rawCategory ,
68
62
InputPosition position ) {
69
- super (gqlStatus , statusDescription , diagnosticRecord );
70
- this .code = Objects .requireNonNull (code );
63
+ this .code = code ;
71
64
this .title = title ;
72
65
this .description = description ;
73
66
this .severityLevel = severityLevel ;
74
67
this .rawSeverityLevel = rawSeverityLevel ;
75
- this .classification = classification ;
76
- this .rawClassification = rawClassification ;
68
+ this .category = category ;
69
+ this .rawCategory = rawCategory ;
77
70
this .position = position ;
78
71
}
79
72
80
- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
81
73
@ Override
82
74
public String code () {
83
75
return code ;
84
76
}
85
77
86
- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
87
78
@ Override
88
79
public String title () {
89
80
return title ;
90
81
}
91
82
92
- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
93
83
@ Override
94
84
public String description () {
95
85
return description ;
96
86
}
97
87
98
- @ SuppressWarnings ({"deprecation" , "RedundantSuppression" })
99
88
@ Override
100
89
public InputPosition position () {
101
90
return position ;
@@ -111,62 +100,21 @@ public Optional<String> rawSeverityLevel() {
111
100
return Optional .ofNullable (rawSeverityLevel );
112
101
}
113
102
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
-
124
103
@ Override
125
104
public Optional <NotificationCategory > category () {
126
- return Optional .ofNullable (classification );
105
+ return Optional .ofNullable (category );
127
106
}
128
107
129
108
@ Override
130
109
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 );
162
111
}
163
112
164
113
@ Override
165
114
public String toString () {
166
115
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 ;
170
118
return position == null ? info : info + ", position={" + position + "}" ;
171
119
}
172
120
}
0 commit comments