Class Triple<A,​B,​C>


  • @Immutable
    public class Triple<A,​B,​C>
    extends java.lang.Object
    A value object that contains a triple of values.
    Since:
    3.2-ALPHA-12
    Author:
    Fabrizio Giudici
    Status: draft API
    • Field Summary

      Fields 
      Modifier and Type Field Description
      A a  
      B b  
      C c  
    • Constructor Summary

      Constructors 
      Constructor Description
      Triple()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​U,​V>
      Triple<T,​U,​V>
      of​(Pair<T,​U> pair, V value)
      Creates a Triple from a Pair and another value.
      static <T,​U>
      java.util.stream.Stream<Triple<T,​U,​java.lang.Integer>>
      tripleRange​(Pair<T,​U> pair, int from, int to)
      Creates a Stream of Triples composed of a given fixed Pair and an integer in the given range.
      static <T,​U>
      java.util.stream.Stream<Triple<T,​U,​java.lang.Integer>>
      tripleRangeClosed​(Pair<T,​U> pair, int from, int to)
      Creates a Stream of Triples composed of a given fixed Pair and an integer in the given range.
      static <T,​U,​V>
      java.util.stream.Stream<Triple<T,​U,​V>>
      tripleStream​(Pair<T,​U> pair, java.util.stream.Stream<? extends V> stream)
      Creates a Stream of Triples composed of a given Pair and another element taken from Stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • a

        @Nonnull
        public final A a
      • b

        @Nonnull
        public final B b
      • c

        @Nonnull
        public final C c
    • Constructor Detail

      • Triple

        public Triple()
    • Method Detail

      • of

        @Nonnull
        public static <T,​U,​V> Triple<T,​U,​V> of​(@Nonnull
                                                                       Pair<T,​U> pair,
                                                                       @Nonnull
                                                                       V value)
        Creates a Triple from a Pair and another value.
        Type Parameters:
        T - the former type of the Pair
        U - the latter type of the Pair
        V - the type of the value
        Parameters:
        pair - the Pair
        value - the value
        Returns:
        the Stream of Triples
      • tripleStream

        @Nonnull
        public static <T,​U,​V> java.util.stream.Stream<Triple<T,​U,​V>> tripleStream​(@Nonnull
                                                                                                          Pair<T,​U> pair,
                                                                                                          @Nonnull
                                                                                                          java.util.stream.Stream<? extends V> stream)
        Creates a Stream of Triples composed of a given Pair and another element taken from Stream.
        Type Parameters:
        T - the former type of the Pair
        U - the latter type of the Pair
        V - the type of the Stream
        Parameters:
        pair - the Pair
        stream - the Stream
        Returns:
        the Stream of Triples
      • tripleRange

        @Nonnull
        public static <T,​U> java.util.stream.Stream<Triple<T,​U,​java.lang.Integer>> tripleRange​(@Nonnull
                                                                                                                 Pair<T,​U> pair,
                                                                                                                 @Nonnegative
                                                                                                                 int from,
                                                                                                                 @Nonnegative
                                                                                                                 int to)
        Creates a Stream of Triples composed of a given fixed Pair and an integer in the given range.
        Type Parameters:
        T - the former type of the Pair
        U - the latter type of the Pair
        Parameters:
        pair - the Pair
        from - the first value of the integer Stream (included)
        to - the last value of the integer Stream (excluded)
        Returns:
        the Stream of Triples
      • tripleRangeClosed

        @Nonnull
        public static <T,​U> java.util.stream.Stream<Triple<T,​U,​java.lang.Integer>> tripleRangeClosed​(@Nonnull
                                                                                                                       Pair<T,​U> pair,
                                                                                                                       @Nonnegative
                                                                                                                       int from,
                                                                                                                       @Nonnegative
                                                                                                                       int to)
        Creates a Stream of Triples composed of a given fixed Pair and an integer in the given range.
        Type Parameters:
        T - the former type of the Pair
        U - the latter type of the Pair
        Parameters:
        pair - the Pair
        from - the first value of the integer Stream (included)
        to - the last value of the integer Stream (included)
        Returns:
        the Stream of Triples