[MAGNOLIA-4649] Node2Bean: use generics to avoid unnecessary cast Created: 06/Nov/12 Updated: 21/Sep/23 |
|
| Status: | Open |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 5.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Jaroslav Simak | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | cleanup, improvement, n2b | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Date of First Response: | |
| Story Points: | 8 |
| Description |
|
Node2BeanProcessor#toBean returns Object which needs to be cast to desired class. |
| Comments |
| Comment by Tobias Mattsson [ 28/Nov/12 ] |
|
Could be done both for the toBean methods and the setProperties() method. public <T> T toBean(Node node) public <T> T toBean(Node node, Class<?> defaultClass) public <T> T toBean(Node node, boolean recursive, final Node2BeanTransformer transformer, ComponentProvider componentProvider) public <T> T setProperties(final T bean, Node node, boolean recursive, final Node2BeanTransformer transformer, ComponentProvider componentProvider) |