All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dominokit.domino.ui.datatable.events.SearchEvent Maven / Gradle / Ivy

There is a newer version: 1.0.139
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy