Skip to content

Commit 3071fdc

Browse files
committed
Add getInstance to TypeSystem
1 parent 39df7ca commit 3071fdc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

driver/src/main/java/org/neo4j/driver/types/TypeSystem.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package org.neo4j.driver.types;
2020

21+
import static org.neo4j.driver.internal.types.InternalTypeSystem.TYPE_SYSTEM;
22+
2123
import org.neo4j.driver.util.Experimental;
2224
import org.neo4j.driver.util.Immutable;
2325

@@ -28,6 +30,10 @@
2830
@Immutable
2931
@Experimental
3032
public interface TypeSystem {
33+
static TypeSystem getInstance() {
34+
return TYPE_SYSTEM;
35+
}
36+
3137
Type ANY();
3238

3339
Type BOOLEAN();

driver/src/test/java/org/neo4j/driver/types/TypeSystemTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.hamcrest.CoreMatchers.not;
2222
import static org.hamcrest.core.Is.is;
2323
import static org.hamcrest.junit.MatcherAssert.assertThat;
24+
import static org.junit.jupiter.api.Assertions.assertEquals;
2425
import static org.neo4j.driver.Values.value;
2526
import static org.neo4j.driver.internal.types.InternalTypeSystem.TYPE_SYSTEM;
2627

@@ -75,6 +76,11 @@ private TypeVerifier newTypeVerifierFor(Type type) {
7576
return new TypeVerifier(type, allValues);
7677
}
7778

79+
@Test
80+
void shouldReturnTypeSystem() {
81+
assertEquals(TYPE_SYSTEM, TypeSystem.getInstance());
82+
}
83+
7884
@Test
7985
void shouldNameTypeCorrectly() {
8086
assertThat(TYPE_SYSTEM.ANY().name(), is("ANY"));

0 commit comments

Comments
 (0)