@@ -42,24 +42,24 @@ public Boolean nullIsNull()
42
42
return echo ( null , record ->
43
43
{
44
44
// tag::java-driver-reading-values-null[]
45
- Value nullValue = record .get ( nullFieldName );
45
+ Value possibleNullValue = record .get ( nullFieldName );
46
46
47
47
// Checking if its null
48
- Boolean trueBoolean = nullValue .isNull (); // true
48
+ boolean wasNull = possibleNullValue .isNull (); // true
49
49
50
50
// end::java-driver-reading-values-null[]
51
- return trueBoolean ;
51
+ return wasNull ;
52
52
} );
53
53
}
54
54
55
55
public String nullAsString ()
56
56
{
57
57
return echo ( null , record ->
58
58
{
59
- Value nullValue = record .get ( nullFieldName );
59
+ Value possibleNullValue = record .get ( nullFieldName );
60
60
// tag::java-driver-reading-values-null[]
61
61
// Getting the null value as string
62
- String stringWithNullContent = nullValue .asString (); // "null"
62
+ String stringWithNullContent = possibleNullValue .asString (); // "null"
63
63
64
64
// end::java-driver-reading-values-null[]
65
65
return stringWithNullContent ;
@@ -70,10 +70,10 @@ public Object nullAsObject()
70
70
{
71
71
return echo ( null , record ->
72
72
{
73
- Value nullValue = record .get ( nullFieldName );
73
+ Value possibleNullValue = record .get ( nullFieldName );
74
74
// tag::java-driver-reading-values-null[]
75
75
// Getting `null` as object
76
- Object nullObject = nullValue .asObject (); // null
76
+ Object nullObject = possibleNullValue .asObject (); // null
77
77
78
78
// end::java-driver-reading-values-null[]
79
79
return nullObject ;
@@ -84,10 +84,10 @@ public float nullAsObjectFloatDefaultValue()
84
84
{
85
85
return echo ( null , record ->
86
86
{
87
- Value nullValue = record .get ( nullFieldName );
87
+ Value possibleNullValue = record .get ( nullFieldName );
88
88
// tag::java-driver-reading-values-null[]
89
89
// Coercing value with a default value set
90
- float floatValue = nullValue .asFloat ( 1.0f ); // 1.0f
90
+ float floatValue = possibleNullValue .asFloat ( 1.0f ); // 1.0f
91
91
92
92
// end::java-driver-reading-values-null[]
93
93
return floatValue ;
@@ -98,10 +98,10 @@ public void nullAsObjectFloat()
98
98
{
99
99
echo ( null , record ->
100
100
{
101
- Value nullValue = record .get ( nullFieldName );
101
+ Value possibleNullValue = record .get ( nullFieldName );
102
102
// tag::java-driver-reading-values-null[]
103
103
// Could not cast null to float
104
- float floatValue = nullValue .asFloat (); // throws org.neo4j.driver.exceptions.value.Uncoercible
104
+ float floatValue = possibleNullValue .asFloat (); // throws org.neo4j.driver.exceptions.value.Uncoercible
105
105
// end::java-driver-reading-values-null[]
106
106
return floatValue ;
107
107
} );
0 commit comments