Class Either.Left<L,R>

java.lang.Object
org.ehrbase.openehr.sdk.util.functional.Either<L,R>
org.ehrbase.openehr.sdk.util.functional.Either.Left<L,R>
Enclosing class:
Either<L,R>

public static class Either.Left<L,R> extends Either<L,R>
  • Method Details

    • isLeft

      public boolean isLeft()
      Specified by:
      isLeft in class Either<L,R>
    • isRight

      public boolean isRight()
      Specified by:
      isRight in class Either<L,R>
    • get

      public L get()
      Specified by:
      get in class Either<L,R>
    • getAsLeft

      public L getAsLeft()
      Specified by:
      getAsLeft in class Either<L,R>
    • getAsRight

      public R getAsRight()
      Specified by:
      getAsRight in class Either<L,R>
    • map

      public <T> T map(BiFunction<L,R,T> map)
      Description copied from class: Either
      Convenience method to transform the internal state
      Specified by:
      map in class Either<L,R>
      Parameters:
      map - function which maps the internal state to the specified type The function must be null safe in both arguments
      Returns:
      the mapped internal state
    • consume

      public void consume(BiConsumer<L,R> con)
      Description copied from class: Either
      Convenience method to consume the internal state
      Specified by:
      consume in class Either<L,R>
      Parameters:
      con - consumer which consumes the internal state The consumer must be null safe in both arguments