org.dominokit.domino.ui.datatable.events.SearchEvent Maven / Gradle / Ivy
package org.dominokit.domino.ui.datatable.events;
import org.dominokit.domino.ui.datatable.model.Category;
import org.dominokit.domino.ui.datatable.model.Filter;
import java.util.List;
import java.util.stream.Collectors;
public class SearchEvent implements TableEvent {
public static final String SEARCH_EVENT = "table-search";
private final List filters;
public SearchEvent(List filters) {
this.filters = filters;
}
public List getFilters() {
return filters;
}
public List getByCategory(Category category) {
return filters.stream().filter(f -> f.getCategory().equals(category)).collect(Collectors.toList());
}
@Override
public String getType() {
return SEARCH_EVENT;
}
}