public interface ProductLine
Modifier and Type | Method and Description |
---|---|
List<Product> |
getAllProducts()
Returns a list of all the products in the product line.
|
List<Product> |
getProductsFilteredBy(Predicate<Product> predicate)
Returns a List<Product> with all products of the product line that
satisfies the predicate.
|
List<Product> getProductsFilteredBy(Predicate<Product> predicate)
Returns a List<Product> with all products of the product line that satisfies the predicate.
Typical usage:
ProductLine productLine = ProductLineFactory.getProductLine(); Listproducts = productLine.getAllProducts(); List strongStuff = productLine.getProductsFilteredBy(p -> p.alcohol() > 70.0);
Which filters out all Products with an alcohol level over 70.0%
predicate
- A Predicate with the criteria for the products to return