Interface Streamable<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Streamable<T> filter​(java.util.function.Predicate<T> predicate)
      Filter out an element if it does not match the supplied predicate.
      <U> Streamable<U> map​(java.util.function.Function<T,​U> mapper)
      Perform a mapping operation on the elements in the stream.
      java.util.stream.Stream<T> stream()
      Creates a Stream to access the entities of type T contained within this Streamable class.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • filter

        Streamable<T> filter​(java.util.function.Predicate<T> predicate)
        Filter out an element if it does not match the supplied predicate. This operation will iterate over all elements and return a new set containing only the elements where the predicate returns true for.
        Parameters:
        predicate - the predicate to apply to the contents of this
        Returns:
        the filtered value
        Throws:
        java.lang.NullPointerException - if predicate is null
      • map

        <U> Streamable<U> map​(java.util.function.Function<T,​U> mapper)
        Perform a mapping operation on the elements in the stream.

        This operation will loop over all elements in the stream and apply the mapper method. The mapped values will be returned in as a new stream of elements.

        Type Parameters:
        U - the type of object expected as a result
        Parameters:
        mapper - the mapping functionality
        Returns:
        the mapped object
      • stream

        java.util.stream.Stream<T> stream()
        Creates a Stream to access the entities of type T contained within this Streamable class.
        Returns:
        the Stream entity.