-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
datatable/java: Support for Optional<T> #1182
Conversation
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.
Looking good! Though the code is a bit repetitive. You can probably use lambda functions or method references to extract out the common parts.
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
- Removed duplicate code - Optional trasnformers now use same functions as regular transformers
…cumber into datatable-java-optional-type
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
datatable/java/datatable/src/main/java/io/cucumber/datatable/DataTableTypeRegistry.java
Outdated
Show resolved
Hide resolved
@rasklaad I've been playing around a bit with automatically registering the optional variant of every table cell transformer that is registered. The problem is a bit more complicated because I'm also adding a new https://github.com/cucumber/cucumber/tree/datatable-java-optional-type-replacement |
@rasklaad I've pushed some changes. Instead of registering transformers for all optionals, we'll look at the type we are trying to convert too. If the type we are trying to convert too is an optional and has an a regular transformer then we'll wrap the regular transformer in an optional transformer and return that. Now I had to throw a whole bunch of tests away. They weren't interesting. They all covered the same thing. When a cell transformer is registered for a type it also works for the optional variant of that type. So we don't need to check all types. What do you think? |
I think this will do. Cheers! |
Summary
Ability to use a tables with Optional types.
Details
I've added a new TableCellTransformers.
Motivation and Context
#1091
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: