isString
and extracted
* using stringValue
.
- * + * *
* Because Neo4j often handles dynamic structures, this interface is designed to help you
diff --git a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueException.java b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueException.java
index 084a84aa..a95f3b22 100644
--- a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueException.java
+++ b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueException.java
@@ -20,18 +20,28 @@
import java.io.Serial;
+/**
+ * The base type for several exception that might occur within the Neo4j value system,
+ * such as a lossy coercion, that might occur when trying to downcast a Cypher
+ * {@code INTEGER} (which is a 64bit integer), into a Java int (which is only 32bit).
+ *
+ * @author Neo4j Drivers Team
+ * @since 6.0.0
+ */
public sealed class ValueException extends
RuntimeException permits LossyCoercion, NotMultiValuedException, UncoercibleException, UnsizableException {
@Serial
private static final long serialVersionUID = 7850167285895596482L;
+ /**
+ * Constructs a new exception with the specified detail message. The cause is not
+ * initialized, and may subsequently be initialized by a call to {@link #initCause}.
+ * @param message the detail message. The detail message is saved for later retrieval
+ * by the {@link #getMessage()} method.
+ */
public ValueException(String message) {
super(message);
}
- public ValueException(String message, Throwable cause) {
- super(message, cause);
- }
-
}
diff --git a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/internal/bolt/value/ValueUtils.java b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueUtils.java
similarity index 92%
rename from neo4j-jdbc/src/main/java/org/neo4j/jdbc/internal/bolt/value/ValueUtils.java
rename to neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueUtils.java
index 6a7538c5..b66cd214 100644
--- a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/internal/bolt/value/ValueUtils.java
+++ b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/ValueUtils.java
@@ -16,16 +16,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.neo4j.jdbc.internal.bolt.value;
+package org.neo4j.jdbc.values;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Function;
-import org.neo4j.jdbc.values.Record;
-import org.neo4j.jdbc.values.Value;
-
final class ValueUtils {
private ValueUtils() {
diff --git a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/Values.java b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/Values.java
index 283a346f..ca1540c6 100644
--- a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/Values.java
+++ b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/Values.java
@@ -409,7 +409,7 @@ public static Value value(final double val) {
* @return the value
*/
public static Value value(final boolean val) {
- return BooleanValue.fromBoolean(val);
+ return val ? BooleanValue.TRUE : BooleanValue.FALSE;
}
/**
diff --git a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/package-info.java b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/package-info.java
index 23223f5b..dfd68877 100644
--- a/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/package-info.java
+++ b/neo4j-jdbc/src/main/java/org/neo4j/jdbc/values/package-info.java
@@ -16,4 +16,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/**
+ * This package contains the Neo4j value systems and is public API.
+ */
package org.neo4j.jdbc.values;
diff --git a/neo4j-jdbc/src/test/java/org/neo4j/jdbc/values/TypeTests.java b/neo4j-jdbc/src/test/java/org/neo4j/jdbc/Neo4jTypeToSqlTypeMapperTests.java
similarity index 92%
rename from neo4j-jdbc/src/test/java/org/neo4j/jdbc/values/TypeTests.java
rename to neo4j-jdbc/src/test/java/org/neo4j/jdbc/Neo4jTypeToSqlTypeMapperTests.java
index 07139cb0..a869f79d 100644
--- a/neo4j-jdbc/src/test/java/org/neo4j/jdbc/values/TypeTests.java
+++ b/neo4j-jdbc/src/test/java/org/neo4j/jdbc/Neo4jTypeToSqlTypeMapperTests.java
@@ -16,17 +16,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.neo4j.jdbc.values;
+package org.neo4j.jdbc;
import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+import org.neo4j.jdbc.values.Type;
import static org.assertj.core.api.Assertions.assertThat;
-class TypeTests {
+class Neo4jTypeToSqlTypeMapperTests {
static Stream