Skip to content

Commit

Permalink
Update: docs - either.md: add isLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Dec 30, 2021
1 parent 8496d90 commit 4a342e3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions website/docs/types/either.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,22 @@ errorMsgOrNum2.isRight();
```

### `Either.isLeft`
To check if the `Either` is `Left`, use `isLeft()`,
```java
import j8plus.types.Either;

final Either<String, Integer> errorMsgOrNum = Either.right(999);
// Either<String, Integer> = Right(999)

errorMsgOrNum.isLeft();
// boolean = false

final Either<String, Integer> errorMsgOrNum2 = Either.left("Error message");
// Either<String, Integer> = Left(Error message)

errorMsgOrNum2.isLeft();
// boolean = true
```


### Example
Expand Down

0 comments on commit 4a342e3

Please sign in to comment.