Hi,
Is there any way to get TARGET type from ValueProvider without using other object? I mean i want to know type of returning function from ValueProvider before adding my list to grid.My problem is:
First i`m creating list of ValueProviders for grid columns like
List<ValueProvider<ObjectDTO,Object>> listValueProviders = new ArrayList<.();
listValueProviders.add(ObjectDTO::getId);
listValueProviders.add(object -> {
return object.getId()>0 ? true : false;});
listValueProviders.add(ObjectDTO::getDate);
then i want to create grid where if return type from ValuePrivder will be Date then add render to column.
if(listValueProviders[i]
instanceof Date)
addColumn(listValueProviders[i]
with render for Date)
else
addColumn(listValueProviders[i]
)
Is there any option to make something like:
(listValueProviders[i]
instanceof Date)
work for ValueProvider? Get Type for TARGET without item list just wihtout source object?
I know that i can use
if(listValueProviders[i]
.apply(source) instanceof Date)
but there is possibility that it will have empty list of source objects before adding columns and that this column will be null then it will return false