Skip to content

Commit 6dd7c0c

Browse files
authored
Unmark TypeSystem as experimental (#1376)
The `TypeSystem` has been available for a significant time. This update removes the experimental status from it.
1 parent 7d0e75c commit 6dd7c0c

File tree

7 files changed

+24
-32
lines changed

7 files changed

+24
-32
lines changed

driver/src/main/java/org/neo4j/driver/Driver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
296296
* The types supported on a particular server a session is connected against might not contain all of the types defined here.
297297
*
298298
* @return type system used by this query runner for classifying values
299+
* @deprecated superseded by {@link TypeSystem#getDefault()}
299300
*/
300301
@Experimental
302+
@Deprecated
301303
TypeSystem defaultTypeSystem();
302304

303305
/**

driver/src/main/java/org/neo4j/driver/Value.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.neo4j.driver.types.Relationship;
4343
import org.neo4j.driver.types.Type;
4444
import org.neo4j.driver.types.TypeSystem;
45-
import org.neo4j.driver.util.Experimental;
4645
import org.neo4j.driver.util.Immutable;
4746

4847
/**
@@ -140,7 +139,6 @@ public interface Value extends MapAccessor, MapAccessorWithDefaultValue {
140139
Value get(int index);
141140

142141
/** @return The type of this value as defined in the Neo4j type system */
143-
@Experimental
144142
Type type();
145143

146144
/**
@@ -149,7 +147,6 @@ public interface Value extends MapAccessor, MapAccessorWithDefaultValue {
149147
* @param type the given type
150148
* @return type.isTypeOf( this )
151149
*/
152-
@Experimental
153150
boolean hasType(Type type);
154151

155152
/**

driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public CompletionStage<Void> closeAsync() {
132132
return completedWithNull();
133133
}
134134

135+
@Deprecated
135136
@Override
136137
public final TypeSystem defaultTypeSystem() {
137138
return InternalTypeSystem.TYPE_SYSTEM;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
package org.neo4j.driver.types;
2020

2121
import org.neo4j.driver.Value;
22-
import org.neo4j.driver.util.Experimental;
2322
import org.neo4j.driver.util.Immutable;
2423

2524
/**
2625
* The type of a {@link Value} as defined by the Cypher language
2726
* @since 1.0
2827
*/
2928
@Immutable
30-
@Experimental
3129
public interface Type {
3230
/**
3331
* @return the name of the Cypher type (as defined by Cypher)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020

2121
import static org.neo4j.driver.internal.types.InternalTypeSystem.TYPE_SYSTEM;
2222

23-
import org.neo4j.driver.util.Experimental;
2423
import org.neo4j.driver.util.Immutable;
2524

2625
/**
2726
* A listing of all database types this driver can handle.
2827
* @since 1.0
2928
*/
3029
@Immutable
31-
@Experimental
3230
public interface TypeSystem {
3331
/**
3432
* Returns an instance of type system.

driver/src/test/java/org/neo4j/driver/integration/ParametersIT.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import static org.neo4j.driver.internal.util.ValueFactory.emptyNodeValue;
3434
import static org.neo4j.driver.internal.util.ValueFactory.emptyRelationshipValue;
3535
import static org.neo4j.driver.internal.util.ValueFactory.filledPathValue;
36+
import static org.neo4j.driver.types.TypeSystem.getDefault;
3637

3738
import java.io.IOException;
3839
import java.util.HashMap;
@@ -67,7 +68,7 @@ void shouldBeAbleToSetAndReturnBooleanProperty() {
6768
// Then
6869
for (Record record : result.list()) {
6970
Value value = record.get("a.value");
70-
assertThat(value.hasType(session.typeSystem().BOOLEAN()), equalTo(true));
71+
assertThat(value.hasType(getDefault().BOOLEAN()), equalTo(true));
7172
assertThat(value.asBoolean(), equalTo(true));
7273
}
7374
}
@@ -80,7 +81,7 @@ void shouldBeAbleToSetAndReturnByteProperty() {
8081
// Then
8182
for (Record record : result.list()) {
8283
Value value = record.get("a.value");
83-
assertThat(value.hasType(session.typeSystem().INTEGER()), equalTo(true));
84+
assertThat(value.hasType(getDefault().INTEGER()), equalTo(true));
8485
assertThat(value.asLong(), equalTo(1L));
8586
}
8687
}
@@ -93,7 +94,7 @@ void shouldBeAbleToSetAndReturnShortProperty() {
9394
// Then
9495
for (Record record : result.list()) {
9596
Value value = record.get("a.value");
96-
assertThat(value.hasType(session.typeSystem().INTEGER()), equalTo(true));
97+
assertThat(value.hasType(getDefault().INTEGER()), equalTo(true));
9798
assertThat(value.asLong(), equalTo(1L));
9899
}
99100
}
@@ -106,7 +107,7 @@ void shouldBeAbleToSetAndReturnIntegerProperty() {
106107
// Then
107108
for (Record record : result.list()) {
108109
Value value = record.get("a.value");
109-
assertThat(value.hasType(session.typeSystem().INTEGER()), equalTo(true));
110+
assertThat(value.hasType(getDefault().INTEGER()), equalTo(true));
110111
assertThat(value.asLong(), equalTo(1L));
111112
}
112113
}
@@ -119,7 +120,7 @@ void shouldBeAbleToSetAndReturnLongProperty() {
119120
// Then
120121
for (Record record : result.list()) {
121122
Value value = record.get("a.value");
122-
assertThat(value.hasType(session.typeSystem().INTEGER()), equalTo(true));
123+
assertThat(value.hasType(getDefault().INTEGER()), equalTo(true));
123124
assertThat(value.asLong(), equalTo(1L));
124125
}
125126
}
@@ -132,7 +133,7 @@ void shouldBeAbleToSetAndReturnDoubleProperty() {
132133
// Then
133134
for (Record record : result.list()) {
134135
Value value = record.get("a.value");
135-
assertThat(value.hasType(session.typeSystem().FLOAT()), equalTo(true));
136+
assertThat(value.hasType(getDefault().FLOAT()), equalTo(true));
136137
assertThat(value.asDouble(), equalTo(6.28));
137138
}
138139
}
@@ -164,10 +165,10 @@ void shouldBeAbleToSetAndReturnBooleanArrayProperty() {
164165
// Then
165166
for (Record record : result.list()) {
166167
Value value = record.get("a.value");
167-
assertThat(value.hasType(session.typeSystem().LIST()), equalTo(true));
168+
assertThat(value.hasType(getDefault().LIST()), equalTo(true));
168169
assertThat(value.size(), equalTo(3));
169170
for (Value item : value.asList(ofValue())) {
170-
assertThat(item.hasType(session.typeSystem().BOOLEAN()), equalTo(true));
171+
assertThat(item.hasType(getDefault().BOOLEAN()), equalTo(true));
171172
assertThat(item.asBoolean(), equalTo(true));
172173
}
173174
}
@@ -182,10 +183,10 @@ void shouldBeAbleToSetAndReturnIntegerArrayProperty() {
182183
// Then
183184
for (Record record : result.list()) {
184185
Value value = record.get("a.value");
185-
assertThat(value.hasType(session.typeSystem().LIST()), equalTo(true));
186+
assertThat(value.hasType(getDefault().LIST()), equalTo(true));
186187
assertThat(value.size(), equalTo(3));
187188
for (Value item : value.asList(ofValue())) {
188-
assertThat(item.hasType(session.typeSystem().INTEGER()), equalTo(true));
189+
assertThat(item.hasType(getDefault().INTEGER()), equalTo(true));
189190
assertThat(item.asLong(), equalTo(42L));
190191
}
191192
}
@@ -200,10 +201,10 @@ void shouldBeAbleToSetAndReturnDoubleArrayProperty() {
200201
// Then
201202
for (Record record : result.list()) {
202203
Value value = record.get("a.value");
203-
assertThat(value.hasType(session.typeSystem().LIST()), equalTo(true));
204+
assertThat(value.hasType(getDefault().LIST()), equalTo(true));
204205
assertThat(value.size(), equalTo(3));
205206
for (Value item : value.asList(ofValue())) {
206-
assertThat(item.hasType(session.typeSystem().FLOAT()), equalTo(true));
207+
assertThat(item.hasType(getDefault().FLOAT()), equalTo(true));
207208
assertThat(item.asDouble(), equalTo(6.28));
208209
}
209210
}
@@ -223,10 +224,10 @@ private static void testStringArrayContaining(String str) {
223224
// Then
224225
for (Record record : result.list()) {
225226
Value value = record.get("a.value");
226-
assertThat(value.hasType(session.typeSystem().LIST()), equalTo(true));
227+
assertThat(value.hasType(getDefault().LIST()), equalTo(true));
227228
assertThat(value.size(), equalTo(3));
228229
for (Value item : value.asList(ofValue())) {
229-
assertThat(item.hasType(session.typeSystem().STRING()), equalTo(true));
230+
assertThat(item.hasType(getDefault().STRING()), equalTo(true));
230231
assertThat(item.asString(), equalTo(str));
231232
}
232233
}
@@ -262,7 +263,7 @@ void shouldBeAbleToSetAndReturnBooleanPropertyWithinMap() {
262263
// Then
263264
for (Record record : result.list()) {
264265
Value value = record.get("a.value");
265-
assertThat(value.hasType(session.typeSystem().BOOLEAN()), equalTo(true));
266+
assertThat(value.hasType(getDefault().BOOLEAN()), equalTo(true));
266267
assertThat(value.asBoolean(), equalTo(true));
267268
}
268269
}
@@ -276,7 +277,7 @@ void shouldBeAbleToSetAndReturnIntegerPropertyWithinMap() {
276277
// Then
277278
for (Record record : result.list()) {
278279
Value value = record.get("a.value");
279-
assertThat(value.hasType(session.typeSystem().INTEGER()), equalTo(true));
280+
assertThat(value.hasType(getDefault().INTEGER()), equalTo(true));
280281
assertThat(value.asLong(), equalTo(42L));
281282
}
282283
}
@@ -290,7 +291,7 @@ void shouldBeAbleToSetAndReturnDoublePropertyWithinMap() {
290291
// Then
291292
for (Record record : result.list()) {
292293
Value value = record.get("a.value");
293-
assertThat(value.hasType(session.typeSystem().FLOAT()), equalTo(true));
294+
assertThat(value.hasType(getDefault().FLOAT()), equalTo(true));
294295
assertThat(value.asDouble(), equalTo(6.28));
295296
}
296297
}
@@ -304,7 +305,7 @@ void shouldBeAbleToSetAndReturnStringPropertyWithinMap() {
304305
// Then
305306
for (Record record : result.list()) {
306307
Value value = record.get("a.value");
307-
assertThat(value.hasType(session.typeSystem().STRING()), equalTo(true));
308+
assertThat(value.hasType(getDefault().STRING()), equalTo(true));
308309
assertThat(value.asString(), equalTo("Mjölnir"));
309310
}
310311
}
@@ -397,7 +398,7 @@ private static void testBytesProperty(byte[] array) {
397398

398399
for (Record record : result.list()) {
399400
Value value = record.get("a.value");
400-
assertThat(value.hasType(session.typeSystem().BYTES()), equalTo(true));
401+
assertThat(value.hasType(getDefault().BYTES()), equalTo(true));
401402
assertThat(value.asByteArray(), equalTo(array));
402403
}
403404
}
@@ -407,7 +408,7 @@ private static void testStringProperty(String string) {
407408

408409
for (Record record : result.list()) {
409410
Value value = record.get("a.value");
410-
assertThat(value.hasType(session.typeSystem().STRING()), equalTo(true));
411+
assertThat(value.hasType(getDefault().STRING()), equalTo(true));
411412
assertThat(value.asString(), equalTo(string));
412413
}
413414
}

driver/src/test/java/org/neo4j/driver/testutil/DatabaseExtension.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import org.neo4j.driver.Session;
5151
import org.neo4j.driver.internal.BoltServerAddress;
5252
import org.neo4j.driver.testutil.CertificateUtil.CertificateKeyPair;
53-
import org.neo4j.driver.types.TypeSystem;
5453
import org.testcontainers.DockerClientFactory;
5554
import org.testcontainers.containers.GenericContainer;
5655
import org.testcontainers.containers.Neo4jContainer;
@@ -149,10 +148,6 @@ public Driver driver() {
149148
return driver;
150149
}
151150

152-
public TypeSystem typeSystem() {
153-
return driver.defaultTypeSystem();
154-
}
155-
156151
public void deleteAndStartNeo4j(Map<String, String> config) {
157152
Map<String, String> updatedConfig = new HashMap<>(defaultConfig);
158153
updatedConfig.putAll(config);

0 commit comments

Comments
 (0)