Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 6ceb590

Browse files
authored
Merge pull request #118 from praveenag/upgrade-to-1.6
Upgrade to 1.6
2 parents 76b5c64 + acaee01 commit 6ceb590

File tree

3 files changed

+66
-16
lines changed

3 files changed

+66
-16
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ext {
7272

7373
argparse4jVersion = '0.7.0'
7474
junitVersion = '4.12'
75-
neo4jJavaVersion = '1.5.1'
75+
neo4jJavaVersion = '1.6.0-beta01'
7676
findbugsVersion = '3.0.0'
7777
jansiVersion = '1.13'
7878
jlineVersion = '2.14.2'

cypher-shell/src/main/java/org/neo4j/shell/prettyprint/OutputFormatter.java

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
import org.neo4j.driver.v1.types.Relationship;
1111
import org.neo4j.shell.state.BoltResult;
1212

13-
import java.util.*;
14-
import java.util.stream.Collectors;
1513
import javax.annotation.Nonnull;
14+
import java.util.Arrays;
15+
import java.util.ArrayList;
16+
import java.util.Map;
17+
import java.util.LinkedHashMap;
18+
import java.util.List;
19+
import java.util.stream.Collectors;
1620

1721
import static java.util.Arrays.asList;
1822
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -31,23 +35,23 @@ public interface OutputFormatter {
3135
@Nonnull default String formatValue(@Nonnull final Value value) {
3236
TypeRepresentation type = (TypeRepresentation) value.type();
3337
switch (type.constructor()) {
34-
case LIST_TyCon:
38+
case LIST:
3539
return listAsString(value.asList(this::formatValue));
36-
case MAP_TyCon:
40+
case MAP:
3741
return mapAsString(value.asMap(this::formatValue));
38-
case NODE_TyCon:
42+
case NODE:
3943
return nodeAsString(value.asNode());
40-
case RELATIONSHIP_TyCon:
44+
case RELATIONSHIP:
4145
return relationshipAsString(value.asRelationship());
42-
case PATH_TyCon:
46+
case PATH:
4347
return pathAsString(value.asPath());
44-
case ANY_TyCon:
45-
case BOOLEAN_TyCon:
46-
case STRING_TyCon:
47-
case NUMBER_TyCon:
48-
case INTEGER_TyCon:
49-
case FLOAT_TyCon:
50-
case NULL_TyCon:
48+
case ANY:
49+
case BOOLEAN:
50+
case STRING:
51+
case NUMBER:
52+
case INTEGER:
53+
case FLOAT:
54+
case NULL:
5155
default:
5256
return value.toString();
5357
}

cypher-shell/src/test/java/org/neo4j/shell/test/bolt/FakeValue.java

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22

33
import org.neo4j.driver.v1.Value;
44
import org.neo4j.driver.v1.exceptions.value.Uncoercible;
5-
import org.neo4j.driver.v1.types.*;
5+
import org.neo4j.driver.v1.types.Entity;
6+
import org.neo4j.driver.v1.types.IsoDuration;
7+
import org.neo4j.driver.v1.types.Node;
8+
import org.neo4j.driver.v1.types.Path;
9+
import org.neo4j.driver.v1.types.Point;
10+
import org.neo4j.driver.v1.types.Relationship;
11+
import org.neo4j.driver.v1.types.Type;
612
import org.neo4j.driver.v1.util.Function;
713

14+
import java.time.ZonedDateTime;
15+
import java.time.LocalDate;
16+
import java.time.LocalDateTime;
17+
import java.time.LocalTime;
18+
import java.time.OffsetTime;
819
import java.util.List;
920
import java.util.Map;
1021

@@ -168,6 +179,41 @@ public Path asPath() {
168179
throw new Uncoercible(getClass().getSimpleName(), "Path");
169180
}
170181

182+
@Override
183+
public LocalDate asLocalDate() {
184+
throw new Uncoercible(getClass().getSimpleName(), "LocalDate");
185+
}
186+
187+
@Override
188+
public OffsetTime asOffsetTime() {
189+
throw new Uncoercible(getClass().getSimpleName(), "OffsetTime");
190+
}
191+
192+
@Override
193+
public LocalTime asLocalTime() {
194+
throw new Uncoercible(getClass().getSimpleName(), "LocalTime");
195+
}
196+
197+
@Override
198+
public LocalDateTime asLocalDateTime() {
199+
throw new Uncoercible(getClass().getSimpleName(), "LocalDateTime");
200+
}
201+
202+
@Override
203+
public ZonedDateTime asZonedDateTime() {
204+
throw new Uncoercible(getClass().getSimpleName(), "ZonedDateTime");
205+
}
206+
207+
@Override
208+
public IsoDuration asIsoDuration() {
209+
throw new Uncoercible(getClass().getSimpleName(), "IsoDuration");
210+
}
211+
212+
@Override
213+
public Point asPoint() {
214+
throw new Uncoercible(getClass().getSimpleName(), "Point");
215+
}
216+
171217
@Override
172218
public Value get(String key, Value defaultValue) {
173219
return null;

0 commit comments

Comments
 (0)