Filtering TreeTable Columns based on Column ObjectType

I am trying to do a string search on TreeTable. On entering the matching string, the selected row is displayed on the frame. The issue I have is that my TreeTable contains columns of different objectstype. I would like to pass only the columns of ObjectType (String).

I am currently passing all columns of the Treetable.

TreeTable.getColumns().stream().map(column -> column.getId().toString()).collect(Collectors.toList())));

Is there a way to filter the columns based on column objecttype (String) as parameter for my string search.

Thank You for help.

Hello, @lokesh.kumar20012012

Identifiers of columns are instances of MetaPropertyPath and you can filter columns in the following way:

    .filter(c -> {
        MetaProperty mp = ((MetaPropertyPath) c.getId()).getMetaProperty();
        return mp.getJavaType() == String.class;

Is it suitable for you?


Hello Daniil,
Yes. This worked for me. Thank you so much. I was able to filter columns based on String DataType.