diff --git a/website/docs/types/either.md b/website/docs/types/either.md index 490e387..71fff51 100644 --- a/website/docs/types/either.md +++ b/website/docs/types/either.md @@ -300,6 +300,22 @@ errorMsgOrNum2.isRight(); ``` ### `Either.isLeft` +To check if the `Either` is `Left`, use `isLeft()`, +```java +import j8plus.types.Either; + +final Either errorMsgOrNum = Either.right(999); +// Either = Right(999) + +errorMsgOrNum.isLeft(); +// boolean = false + +final Either errorMsgOrNum2 = Either.left("Error message"); +// Either = Left(Error message) + +errorMsgOrNum2.isLeft(); +// boolean = true +``` ### Example