Usually you create a Filter Class with all fields you want to filter, so it might has a strong similarity to the bean you display in the grid. And the instance of the filter class can be applied to the data view, which returns when you set items to the grid component.
There is a pretty good example in the Filtering section of the documentation. https://vaadin.com/docs/latest/components/grid#filtering