Class Either.Right<L,R>

java.lang.Object
com.comphenix.protocol.wrappers.Either<L,R>
com.comphenix.protocol.wrappers.Either.Right<L,R>
Enclosing class:
Either<L,R>

public static class Either.Right<L,R> extends Either<L,R>
  • Constructor Details

    • Right

      protected Right(R value)
  • Method Details

    • map

      public <T> T map(Function<L,T> leftConsumer, Function<R,T> rightConsumer)
      Specified by:
      map in class Either<L,R>
      Type Parameters:
      T - result data type of both transformers
      Parameters:
      leftConsumer - transformer if the left value is present
      rightConsumer - transformer if the right value is present
      Returns:
      result of applying the given functions to the left or right side
    • left

      public Optional<L> left()
      Specified by:
      left in class Either<L,R>
      Returns:
      left value if present
    • right

      public Optional<R> right()
      Specified by:
      right in class Either<L,R>
      Returns:
      right value if present