Skip to content

Commit fef2534

Browse files
committed
Addressing PR suggestions
1 parent baf0d82 commit fef2534

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

examples/src/main/java/org/neo4j/docs/driver/ReadingValuesExample.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ public Boolean nullIsNull()
4242
return echo( null, record ->
4343
{
4444
// tag::java-driver-reading-values-null[]
45-
Value nullValue = record.get( nullFieldName );
45+
Value possibleNullValue = record.get( nullFieldName );
4646

4747
// Checking if its null
48-
Boolean trueBoolean = nullValue.isNull(); // true
48+
boolean wasNull = possibleNullValue.isNull(); // true
4949

5050
// end::java-driver-reading-values-null[]
51-
return trueBoolean;
51+
return wasNull;
5252
} );
5353
}
5454

5555
public String nullAsString()
5656
{
5757
return echo( null, record ->
5858
{
59-
Value nullValue = record.get( nullFieldName );
59+
Value possibleNullValue = record.get( nullFieldName );
6060
// tag::java-driver-reading-values-null[]
6161
// Getting the null value as string
62-
String stringWithNullContent = nullValue.asString(); // "null"
62+
String stringWithNullContent = possibleNullValue.asString(); // "null"
6363

6464
// end::java-driver-reading-values-null[]
6565
return stringWithNullContent;
@@ -70,10 +70,10 @@ public Object nullAsObject()
7070
{
7171
return echo( null, record ->
7272
{
73-
Value nullValue = record.get( nullFieldName );
73+
Value possibleNullValue = record.get( nullFieldName );
7474
// tag::java-driver-reading-values-null[]
7575
// Getting `null` as object
76-
Object nullObject = nullValue.asObject(); // null
76+
Object nullObject = possibleNullValue.asObject(); // null
7777

7878
// end::java-driver-reading-values-null[]
7979
return nullObject;
@@ -84,10 +84,10 @@ public float nullAsObjectFloatDefaultValue()
8484
{
8585
return echo( null, record ->
8686
{
87-
Value nullValue = record.get( nullFieldName );
87+
Value possibleNullValue = record.get( nullFieldName );
8888
// tag::java-driver-reading-values-null[]
8989
// 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
9191

9292
// end::java-driver-reading-values-null[]
9393
return floatValue;
@@ -98,10 +98,10 @@ public void nullAsObjectFloat()
9898
{
9999
echo( null, record ->
100100
{
101-
Value nullValue = record.get( nullFieldName );
101+
Value possibleNullValue = record.get( nullFieldName );
102102
// tag::java-driver-reading-values-null[]
103103
// 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
105105
// end::java-driver-reading-values-null[]
106106
return floatValue;
107107
} );

0 commit comments

Comments
 (0)