Package dev.hypera.chameleon.util
Interface Pair<A,B>
-
- Type Parameters:
A- First type.B- Second type.
@NonExtendable public interface Pair<A,B>Pair, stores two values together.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Afirst()Returns the first value.static <A,B>
@NotNull Pair<A,B>of(A first, B second)Returns a new pair with the given values.Bsecond()Returns the second value.
-
-
-
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.
-
-