Last active
March 6, 2018 23:12
-
-
Save kolov/708b597021741d76bf72f2db7ea3a627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getDates(product: String): Future[Either[String, List[LocalDate]]] = product match { | |
case "fast" => Future.successful(Right(List(LocalDate.parse("2018-03-09"), LocalDate.parse("2018-03-10")))) | |
case "slow" => Future.successful(Right(List(LocalDate.parse("2018-03-07"), LocalDate.parse("2018-03-08")))) | |
case "express" => Future.successful(Left("Service not available")) | |
case "flash" => Future.failed(new Throwable("haha")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment