我试图做的是从sourceListContainerList
和verbosityListContainer
到componentSearchboxContainerText
和detailsSearchboxContainerText
一起过滤值。
我试图遍历sourceListContainerList
和verbosityListContainer
中的值,并将它们添加到Predicate
中,但是最终表现得很奇怪,而且似乎不可行解决问题。
public void filter(){
ObservableList<String> sourceListContainerList = filtersContainer.getSourceListContainerList();
ObservableList<String> verbosityListContainerList = filtersContainer.getVerbosityListContainerList();
String componentSearchboxContainerText = filtersContainer.getComponentSearchboxContainerText();
String detailsSearchboxContainerText = filtersContainer.getDetailsSearchboxContainerText();
System.out.println("Source list values: " + sourceListContainerList);
System.out.println("Verbosity list values: " + verbosityListContainerList);
System.out.println("Component search value: " + componentSearchboxContainerText);
System.out.println("Details search value: " + detailsSearchboxContainerText);
logFilteredList.setPredicate(log ->
log.getComponent().toLowerCase().contains(componentSearchboxContainerText.toLowerCase()) &&
log.getDetails().toLowerCase().contains(detailsSearchboxContainerText.toLowerCase())
);
}
我希望logFilteredList
可以过滤所有4个值/值列表。