Interface Pentuple<T1,​T2,​T3,​T4,​T5>

  • Type Parameters:
    T1 - The type of the first value
    T2 - The type of the second value
    T3 - The type of the third value
    T4 - The type of the fourth value
    T5 - The type of the fifth value
    All Superinterfaces:
    ViewableAsPentuple<T1,​T2,​T3,​T4,​T5>

    public interface Pentuple<T1,​T2,​T3,​T4,​T5>
    extends ViewableAsPentuple<T1,​T2,​T3,​T4,​T5>
    A pentuple is a simple composition of five arbitrary values (objects). A pentuple captures no semantics of the five values, and they are only referred to as "the first", "the second", "the third", "the fourth", and "the fifth" value.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Pentuple<T1,​T2,​T3,​T4,​T5> asPentuple()  
      T5 fifth()  
      T1 first()  
      static <T1,​T2,​T3,​T4,​T5>
      Pentuple<T1,​T2,​T3,​T4,​T5>
      flatten​(Tuple<Tuple<Tuple<Tuple<T1,​T2>,​T3>,​T4>,​T5> nestedTuple)  
      T4 fourth()  
      <S1,​S2,​S3,​S4,​S5>
      Pentuple<S1,​S2,​S3,​S4,​S5>
      map​(Function<? super T1,​? extends S1> firstMapper, Function<? super T2,​? extends S2> secondMapper, Function<? super T3,​? extends S3> thirdMapper, Function<? super T4,​? extends S4> fourthMapper, Function<? super T5,​? extends S5> fifthMapper)
      Create a new pentuple by applying a function to each element, and putting the results into a new pentuple.
      <S5> Pentuple<T1,​T2,​T3,​T4,​S5> mapFifth​(Function<? super T5,​? extends S5> mapper)
      Create a new pentuple by applying a function to the fifth element, and putting the result as the fifth element of the new pentuple.
      <S1> Pentuple<S1,​T2,​T3,​T4,​T5> mapFirst​(Function<? super T1,​? extends S1> mapper)
      Create a new pentuple by applying a function to the first element, and putting the result as the first element of the new pentuple.
      <S4> Pentuple<T1,​T2,​T3,​S4,​T5> mapFourth​(Function<? super T4,​? extends S4> mapper)
      Create a new pentuple by applying a function to the fourth element, and putting the result as the fourth element of the new pentuple.
      <S2> Pentuple<T1,​S2,​T3,​T4,​T5> mapSecond​(Function<? super T2,​? extends S2> mapper)
      Create a new pentuple by applying a function to the second element, and putting the result as the second element of the new pentuple.
      <S3> Pentuple<T1,​T2,​S3,​T4,​T5> mapThird​(Function<? super T3,​? extends S3> mapper)
      Create a new pentuple by applying a function to the third element, and putting the result as the third element of the new pentuple.
      static <T1,​T2,​T3,​T4,​T5>
      Pentuple<T1,​T2,​T3,​T4,​T5>
      of​(T1 first, T2 second, T3 third, T4 fourth, T5 fifth)  
      T2 second()  
      T3 third()  
      <R> R to​(PentaFunction<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​R> convertor)
      Convert this pentuple to an instance of an arbitrary type.
    • Method Detail

      • of

        static <T1,​T2,​T3,​T4,​T5> Pentuple<T1,​T2,​T3,​T4,​T5> of​(T1 first,
                                                                                                            T2 second,
                                                                                                            T3 third,
                                                                                                            T4 fourth,
                                                                                                            T5 fifth)
      • flatten

        static <T1,​T2,​T3,​T4,​T5> Pentuple<T1,​T2,​T3,​T4,​T5> flatten​(Tuple<Tuple<Tuple<Tuple<T1,​T2>,​T3>,​T4>,​T5> nestedTuple)
      • first

        T1 first()
        Returns:
        the first value
      • second

        T2 second()
        Returns:
        the second value
      • third

        T3 third()
        Returns:
        the third value
      • fourth

        T4 fourth()
        Returns:
        the fourth value
      • fifth

        T5 fifth()
        Returns:
        the fifth value
      • mapFirst

        <S1> Pentuple<S1,​T2,​T3,​T4,​T5> mapFirst​(Function<? super T1,​? extends S1> mapper)
        Create a new pentuple by applying a function to the first element, and putting the result as the first element of the new pentuple.
        Parameters:
        mapper - the function to apply to the first element
        Returns:
        the new pentuple
      • mapSecond

        <S2> Pentuple<T1,​S2,​T3,​T4,​T5> mapSecond​(Function<? super T2,​? extends S2> mapper)
        Create a new pentuple by applying a function to the second element, and putting the result as the second element of the new pentuple.
        Parameters:
        mapper - the function to apply to the second element
        Returns:
        the new pentuple
      • mapThird

        <S3> Pentuple<T1,​T2,​S3,​T4,​T5> mapThird​(Function<? super T3,​? extends S3> mapper)
        Create a new pentuple by applying a function to the third element, and putting the result as the third element of the new pentuple.
        Parameters:
        mapper - the function to apply to the third element
        Returns:
        the new pentuple
      • mapFourth

        <S4> Pentuple<T1,​T2,​T3,​S4,​T5> mapFourth​(Function<? super T4,​? extends S4> mapper)
        Create a new pentuple by applying a function to the fourth element, and putting the result as the fourth element of the new pentuple.
        Parameters:
        mapper - the function to apply to the fourth element
        Returns:
        the new pentuple
      • mapFifth

        <S5> Pentuple<T1,​T2,​T3,​T4,​S5> mapFifth​(Function<? super T5,​? extends S5> mapper)
        Create a new pentuple by applying a function to the fifth element, and putting the result as the fifth element of the new pentuple.
        Parameters:
        mapper - the function to apply to the fifth element
        Returns:
        the new pentuple
      • map

        <S1,​S2,​S3,​S4,​S5> Pentuple<S1,​S2,​S3,​S4,​S5> map​(Function<? super T1,​? extends S1> firstMapper,
                                                                                                      Function<? super T2,​? extends S2> secondMapper,
                                                                                                      Function<? super T3,​? extends S3> thirdMapper,
                                                                                                      Function<? super T4,​? extends S4> fourthMapper,
                                                                                                      Function<? super T5,​? extends S5> fifthMapper)
        Create a new pentuple by applying a function to each element, and putting the results into a new pentuple.
        Parameters:
        firstMapper - the function to apply to the first element
        secondMapper - the function to apply to the second element
        thirdMapper - the function to apply to the third element
        fourthMapper - the function to apply to the fourth element
        fifthMapper - the function to apply to the fifth element
        Returns:
        the new pentuple
      • to

        <R> R to​(PentaFunction<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​R> convertor)
        Convert this pentuple to an instance of an arbitrary type.
        Type Parameters:
        R - The type of the resulting instance
        Parameters:
        convertor - the function used to convert the contained values to a resulting compound instance.
        Returns:
        the result from the given function