Interface Pair<A,​B>

  • Type Parameters:
    A - First type.
    B - Second type.

    @NonExtendable
    public interface Pair<A,​B>
    Pair, stores two values together.
    • Method Detail

      • of

        @NotNull
        static <A,​B> @NotNull Pair<A,​B> of​(@NotNull
                                                       A first,
                                                       @NotNull
                                                       B second)
        Returns a new pair with the given values.
        Type Parameters:
        A - First type.
        B - Second type.
        Parameters:
        first - First value.
        second - Second value.
        Returns:
        new pair.
      • first

        @NotNull
        A first()
        Returns the first value.
        Returns:
        an optional containing the first value, if not null, otherwise an empty optional.
      • second

        @NotNull
        B second()
        Returns the second value.
        Returns:
        an optional containing the second value, if not null, otherwise an empty optional.