Interface Filter<T,R>

Type Parameters:
T - the value type for the transformed objects
R - 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 Type
    Method
    Description
    Return a new object of type R which contains the elements of the applied filter functions.
    filter(Predicate<? super T> predicate)
    Return a filter consisting of the elements of this filter that matches the given predicate.
    flatMap(Function<? super T,? extends List<T>> mapper)
    Return a filter consisting of the results of replacing each element with the contents of the mapped elements.
    listMap(Function<? super List<T>,? extends List<T>> mapper)
    Return a filter with the results of the applying given mapper function.
    map(Function<? super T,? extends T> mapper)
    Return a filter with the results of applying the given mapper function.
  • Method Details

    • filter

      Filter<T,R> filter(Predicate<? super T> predicate)
      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

      Filter<T,R> map(Function<? super T,? extends T> mapper)
      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

      Filter<T,R> flatMap(Function<? super T,? extends List<T>> mapper)
      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

      Filter<T,R> listMap(Function<? super List<T>,? extends List<T>> mapper)
      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

      R build()
      Return a new object of type R which contains the elements of the applied filter functions.
      Returns:
      a new object created from the given filter