-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
3
-
False
-
False
-
-
2021 Week 40-42 (from Oct 4), 2021 Week 46-48 (from Nov 15), 2021 Week 49-51 (from Dec 6th)
Currently DataContext conversion is done through an as() method. The `as()` method internally delegates to an ObjectMapper.
DataContext and Castable both provide an {as()}} method. DefaultCastable provide a default implementation.
However, this makes it necessary for user classes to implement the `as()` method (usually through the DefaultCastable interface).
The as() instance method is really only for esthetic reasons – or, in other words, for lack of extension methods in Java.
A static method such as Convert.from(obj).to(target) would be just as good.
Thus:
- we remove the as() method from DataContext
- we rename DefaultCastable to DefaultConversion
- we remove the implements clause from DefaultConversion
- we delete the Castable class.
- we create the class/methods for Convert.from(obj).to(target)
- optional: DefaultConversion#as(Class<T> t) invokes Convert.from(this).to(t)
System classes will always implement DefaultConversion to provide the as() utility method. Users can opt-in whether they want to implement it or use the static version.
- blocks
-
KOGITO-6252 Public API: Incubation (round 3)
- Open