-
Notifications
You must be signed in to change notification settings - Fork 119
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
chore: rewrite document api #1178
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… document-api-rewrite
derklaro
added
v: 4.X
This pull should be included in the 4.0 release
in: driver
An issue/pull request releated to the driver module code
t: improvement
The pull request improves existing code
in: common
An issue/pull request releated to the common module code
labels
Apr 9, 2023
0utplay
approved these changes
Apr 11, 2023
driver/src/main/java/eu/cloudnetservice/driver/document/Document.java
Outdated
Show resolved
Hide resolved
driver/src/main/java/eu/cloudnetservice/driver/document/DocumentSerialisationException.java
Show resolved
Hide resolved
driver/src/main/java/eu/cloudnetservice/driver/module/driver/DriverModule.java
Show resolved
Hide resolved
derklaro
added a commit
that referenced
this pull request
Apr 17, 2023
### Motivation At the moment the document api is very limited due to the reason that practically only the json implementation is used everywhere. While there is an abstract interface for a Document that specifies most of the methods implemented in the json implementation, that interface cannot really be used for custom implementations as the exposed api never accepts the custom implementation. ### Modification The whole Document api has been rewritten and the Document interface is now used everywhere in the api, allowing to use custom document types. To make this work, this PR also contains a way to transfer the key-value pairs from one document type to another. To follow the internal structure of having one mutable type and one immutable type for everything (to make it clear when something can/should be edited, an when that shouldn't be the case) the document is now split up into mutable and immutable as well. ### Result Way cleaner document implementation with proper support for custom document types.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: common
An issue/pull request releated to the common module code
in: driver
An issue/pull request releated to the driver module code
t: improvement
The pull request improves existing code
v: 4.X
This pull should be included in the 4.0 release
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
At the moment the document api is very limited due to the reason that practically only the json implementation is used everywhere. While there is an abstract interface for a Document that specifies most of the methods implemented in the json implementation, that interface cannot really be used for custom implementations as the exposed api never accepts the custom implementation.
Modification
The whole Document api has been rewritten and the Document interface is now used everywhere in the api, allowing to use custom document types. To make this work, this PR also contains a way to transfer the key-value pairs from one document type to another. To follow the internal structure of having one mutable type and one immutable type for everything (to make it clear when something can/should be edited, an when that shouldn't be the case) the document is now split up into mutable and immutable as well.
Result
Way cleaner document implementation with proper support for custom document types.