Class StreamUtils

java.lang.Object
org.keycloak.models.map.common.StreamUtils

public class StreamUtils extends Object
Author:
hmlnarik
  • Constructor Details

    • StreamUtils

      public StreamUtils()
  • Method Details

    • leftInnerJoinStream

      public static <K, V> Stream<StreamUtils.Pair<K,V>> leftInnerJoinStream(Stream<K> stream, Function<? super K,Stream<V>> mapper)
      Creates a stream of pairs that join two streams. For each element k from the stream and each element v obtained from the stream returned by the mapper for k, generates a stream of pairs (k, v).

      Effectively performs equivalent of a LEFT INNER JOIN SQL operation on streams.

      Type Parameters:
      K -
      V -
      Parameters:
      stream -
      mapper -
      Returns:
    • leftInnerJoinIterable

      public static <K, V> Stream<StreamUtils.Pair<K,V>> leftInnerJoinIterable(Stream<K> stream, Function<? super K,? extends Iterable<V>> mapper)
      Creates a stream of pairs that join two streams. For each element k from the stream and each element v obtained from the Iterable returned by the mapper for k, generates a stream of pairs (k, v).

      Effectively performs equivalent of a LEFT INNER JOIN SQL operation on streams.

      Type Parameters:
      K -
      V -
      Parameters:
      stream -
      mapper -
      Returns: