3 ms·
It looks like the generics used to be there but have been removed. Because there is one generic type 'T' left in the implementation of ClassUtils.setIfNotNull.
by misja111 10y ago
It looks like the generics used to be there but have been removed. Because there is one generic type 'T' left in the implementation of ClassUtils.setIfNotNull.
So about this setIfNotNull: I don't understand why this method is used in updateEntity. To me it seems the accountType property in the dto can be set with whatever is in the entity, null or not null.
And of course, Java 8 has introduced the Optional class as a better way of dealing with null values, so why bother writing a workaround at all?
- hepta 10y agoI see now, probably just something to do with formatting/escaping, the <> are being swallowed. Yes, it's strange. I'd prefer to map a null in a DTO to an empty optional. I'd like even more to never have nulls in the dto in the first place.