-
Notifications
You must be signed in to change notification settings - Fork 155
Replaced Point2D and Point3D with Point #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Format with type was never used, all values have always been formatted "by value". This commit just forces all `Value` implementations to have `#toString()`.
Driver is now able to send and receive instances of Date type. They are represented as `java.time.LocalDate` objects.
It is useless because current driver version is a pre-release version.
Driver is now able to send and receive instances of Time type. They are represented as `java.time.OffsetTime` objects.
Driver is now able to send and receive instances of LocalTime type. They are represented as `java.time.LocalTime` objects.
Driver is now able to send and receive instances of LocalDateTime type. They are represented as `java.time.LocalDateTime` objects.
Driver is now able to send and receive instances of DateTime type. They are represented as `java.time.ZonedDateTime` objects. `ZonedDateTime` instances contain time zone information either as numeric offset or as a zone id/name.
Driver is now able to send and receive instances of Duration type. They are represented as instances of custom `org.neo4j.driver.v1.types.Duration` interface. It's needed because Cypher's duration contains months, days, seconds and nanoseconds. There exists no default class in `java.time` package to represent a combination of these temporal values.
Removed "_TyCon" suffix, made code use `#toString()` instead of `#typeName()`.
Instead of direct constructor invocation. So creation of value implementations and internal classes only live in `Values` helper class and is not duplicated.
By extracting generic test methods.
To assert that driver can send and receive DateTime with time zone information as offset and zone name.
By using method references and lambdas instead of static final function implementations.
So it does not clash with `java.time.Duration` and specifies that it's a combination of date-based amount and time-based amount.
Driver represents duration as a custom `IsoDuration` interface. It's a combination of date-based amount and time-based amount. This commit makes driver accept `java.time.Period` and `java.time.Duration` as parameters and convert them to `IsoDuration`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changes are Ok.
I made a couple of small comments. Apart from this, 3D CRS support seems to be merged on the server side, so I think we can add 3D point tests to the SpatialTypesIT
- probably as another PR?
* <p> | ||
* Value that represents a 3D point can be created using {@link Values#point3D(long, double, double, double)} method. | ||
* Value that represents a point can be created using {@link Values#point(int, double, double)} method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also add a reference to the Values#point(int, double, double, double)
overload?
private final double x; | ||
private final double y; | ||
private final double z; | ||
|
||
public InternalPoint3D( long srid, double x, double y, double z ) | ||
public InternalPoint3D( int srid, double x, double y ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this constructor since we already have a distinct InternalPoint2D
?
Based on #474