- Type Parameters:
T- the value type for the transformed objectsR- the result type of the filtered object
- All Known Implementing Classes:
Route.Builder,Track.Builder,TrackSegment.Builder
public interface Filter<T,R>
Filter interface which contains the
filter, map,
flatMap and listMap methods for transforming values from
type T.- Since:
- 1.1
- Version:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Return a new object of typeRwhich contains the elements of the applied filter functions.Return a filter consisting of the elements of this filter that matches the given predicate.Return a filter consisting of the results of replacing each element with the contents of the mapped elements.Return a filter with the results of the applying given mapper function.Return a filter with the results of applying the given mapper function.
-
Method Details
-
filter
Return a filter consisting of the elements of this filter that matches the given predicate.- Parameters:
predicate- a non-interfering, stateless predicate to apply to each element to determine if it should be included- Returns:
- a new filter
-
map
Return a filter with the results of applying the given mapper function.- Parameters:
mapper- a non-interfering, stateless function to apply to each element- Returns:
- a new filter
-
flatMap
Return a filter consisting of the results of replacing each element with the contents of the mapped elements.- Parameters:
mapper- a non-interfering, stateless function to apply to each element which produces a list of new values- Returns:
- a new filter
-
listMap
Return a filter with the results of the applying given mapper function.- Parameters:
mapper- a non-interfering, stateless function to apply to the existing elements- Returns:
- a new filter
-
build
Return a new object of typeRwhich contains the elements of the applied filter functions.- Returns:
- a new object created from the given filter
-