Skip to content

Commit 0553149

Browse files
committed
Update
1 parent bd199af commit 0553149

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

driver/src/main/java/org/neo4j/driver/internal/summary/InternalGqlNotification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.neo4j.driver.summary.GqlNotification;
2525
import org.neo4j.driver.summary.InputPosition;
2626

27-
public class InternalGqlNotification extends InternalGqlStatusObject implements GqlNotification {
27+
public final class InternalGqlNotification extends InternalGqlStatusObject implements GqlNotification {
2828
private final InputPosition position;
2929
private final NotificationSeverity severityLevel;
3030
private final String rawSeverityLevel;

driver/src/main/java/org/neo4j/driver/internal/summary/InternalGqlStatusObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.neo4j.driver.Values;
2323
import org.neo4j.driver.summary.GqlStatusObject;
2424

25-
public class InternalGqlStatusObject implements GqlStatusObject {
25+
public sealed class InternalGqlStatusObject implements GqlStatusObject permits InternalGqlNotification {
2626
public static final GqlStatusObject SUCCESS = new InternalGqlStatusObject(
2727
"00000",
2828
"note: successful completion",

driver/src/main/java/org/neo4j/driver/summary/GqlNotification.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
import java.util.Optional;
2020
import org.neo4j.driver.NotificationClassification;
2121
import org.neo4j.driver.NotificationSeverity;
22+
import org.neo4j.driver.internal.summary.InternalGqlNotification;
2223
import org.neo4j.driver.util.Preview;
2324

2425
/**
2526
* A notification subtype of the {@link GqlStatusObject}.
26-
* @since 5.28.6
27+
* @since 5.28.8
2728
* @see GqlStatusObject
2829
*/
2930
@Preview(name = "GQL-status object")
30-
public interface GqlNotification extends GqlStatusObject {
31+
public sealed interface GqlNotification extends GqlStatusObject permits InternalGqlNotification {
3132

3233
/**
3334
* Returns a position in the query where this notification points to.

driver/src/main/java/org/neo4j/driver/summary/GqlStatusObject.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.util.Map;
2020
import org.neo4j.driver.Value;
21+
import org.neo4j.driver.internal.summary.InternalGqlStatusObject;
2122
import org.neo4j.driver.util.Preview;
2223

2324
/**
@@ -26,7 +27,7 @@
2627
* @see GqlNotification Notification subtype of the GQL-status object
2728
*/
2829
@Preview(name = "GQL-status object")
29-
public interface GqlStatusObject {
30+
public sealed interface GqlStatusObject permits GqlNotification, InternalGqlStatusObject {
3031
/**
3132
* Returns the GQLSTATUS as defined by the GQL standard.
3233
* @return the GQLSTATUS value

driver/src/test/java/org/neo4j/driver/internal/util/MetadataExtractorTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import org.neo4j.driver.internal.adaptedbolt.DriverBoltConnection;
5353
import org.neo4j.driver.internal.summary.InternalInputPosition;
5454
import org.neo4j.driver.summary.GqlNotification;
55-
import org.neo4j.driver.summary.Notification;
5655
import org.neo4j.driver.summary.ResultSummary;
5756

5857
class MetadataExtractorTest {
@@ -405,7 +404,7 @@ void shouldBuildResultSummaryWithGqlStatusObjects() {
405404
assertEquals("SECURITY", firstNotification.rawCategory().get());
406405
assertEquals(new InternalInputPosition(42, 4242, 424242), firstNotification.position());
407406

408-
assertFalse(secondGqlStatusObject instanceof Notification);
407+
assertFalse(secondGqlStatusObject instanceof GqlNotification);
409408
assertEquals("gql_status", secondGqlStatusObject.gqlStatus());
410409
assertEquals("status_description", secondGqlStatusObject.statusDescription());
411410
assertEquals(

0 commit comments

Comments
 (0)