Class Pair<L,R>

java.lang.Object
xyz.jpenilla.squaremap.api.Pair<L,R>
Type Parameters:
L - Left generic type argument
R - Right generic type argument

public final class Pair<L,R> extends Object
Data class for holding a pair of non-null objects with generic types.
  • Method Details

    • left

      public @NonNull L left()
      Get the left value
      Returns:
      Left value
    • right

      public @NonNull R right()
      Get the right value
      Returns:
      Right value
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • of

      public static <L, R> @NonNull Pair<L,R> of(@NonNull L left, @NonNull R right)
      Create a new Pair
      Type Parameters:
      L - Left generic type
      R - Right generic type
      Parameters:
      left - Left value
      right - Right value
      Returns:
      new pair