Converts a scala.util.Either to a javascalautils.Either.
Converts a scala.util.Either to a javascalautils.Either.
val jEitherLeft = asJavaEither(Left("Left is not to the Right")) val jEitherRight = asJavaEither(Right("Left is not to the Right"))
The type to be converted
The converted type
1.0
Converts a scala.util.Failure to a javascalautils.Failure.
Converts a scala.util.Failure to a javascalautils.Failure.
val jfailure = asJavaFailure(Failure(new Exception("Error, terror!!!")))
The type to be converted
The converted type
1.0
Converts a scala.concurrent.Future -> javascalautils.concurrent.Future.
Converts a scala.concurrent.Future -> javascalautils.concurrent.Future.
val future = Future { Thread.sleep(50) "The Future is right here!" } val jfuture = asJavaFuture(future)
The type to be converted
The converted type
1.0
Converts a scala.util.Left to a javascalautils.Left.
Converts a scala.util.Left to a javascalautils.Left.
val jLeft = asJavaLeft(Left("Left is not to the Right"))
The type to be converted
The converted type
1.0
Converts a scala.None to a javascalautils.None.
Converts a scala.None to a javascalautils.None.
val jnone = asJavaNone(None)
The type to be converted
The converted type
1.0
Converts a scala.Option to a javascalautils.Option.
Converts a scala.Option to a javascalautils.Option.
val joptionSome = asJavaOption(Some("Some is never None")) val joptionNone = asJavaOption(None)
The type to be converted
The converted type
1.0
Converts a scala.util.Right to a javascalautils.Right.
Converts a scala.util.Right to a javascalautils.Right.
val jright = asJavaRight(Right("Left is not to the Right"))
The type to be converted
The converted type
1.0
Converts a scala.Some to a javascalautils.Some.
Converts a scala.Some to a javascalautils.Some.
val jsome = asJavaSome(Some("Some is never None"))
The type to be converted
The converted type
1.0
Converts a scala.util.Success to a javascalautils.Success.
Converts a scala.util.Success to a javascalautils.Success.
val jSuccess = asJavaSuccess(Success("Success is not Failure"))
The type to be converted
The converted type
1.0
Converts a scala.util.Try to a javascalautils.Try.
Converts a scala.util.Try to a javascalautils.Try.
val jTryFailure = asJavaTry(Failure(new Exception("Error, terror!!!"))) val jTrySuccess = asJavaTry(Success("Success is not Failure"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Either to a scala.util.Either.
Converts a javascalautils.Either to a scala.util.Either.
import javascalautils.{ Either => JEither, Left => JLeft, Right => JRight } val eitherRight = asScalaEither(new JRight[String,String]("Left is not Right")) val eitherLeft = asScalaEither(new JLeft[String,String]("Left is not Right"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Failure to a scala.util.Failure.
Converts a javascalautils.Failure to a scala.util.Failure.
import javascalautils.{Try => JTry, Success => JSuccess, Failure => JFailure} val failure = asScalaFailure(new JFailure(new Exception("Error, terror")))
The type to be converted
The converted type
1.0
Converts a javascalautils.concurrent.Future to a scala.concurrent.Future.
Converts a javascalautils.concurrent.Future to a scala.concurrent.Future.
import javascalautils.concurrent.{ Future => JFuture } //just illustrating a Java Future by creating an already fulfilled one val future = asScalaFuture(JFuture.successful("The Future is here"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Left to a scala.util.Left.
Converts a javascalautils.Left to a scala.util.Left.
import javascalautils.{ Either => JEither, Left => JLeft, Right => JRight } val left = asScalaLeft(new JLeft[String,String]("Left is not Right"))
The type to be converted
The converted type
1.0
Converts a javascalautils.None to a scala.None.
Converts a javascalautils.None to a scala.None.
import javascalautils.{ None => JNone, Option => JOption, Some => JSome } val optionNone = asScalaOption(new JNone())
The type to be converted
The converted type
1.0
Converts a javascalautils.Option to a scala.Option.
Converts a javascalautils.Option to a scala.Option.
import javascalautils.{ None => JNone, Option => JOption, Some => JSome } val optionNone = asScalaOption(new JNone()) val optionSome = asScalaOption(new JSome("Some is never None"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Right to a scala.util.Right.
Converts a javascalautils.Right to a scala.util.Right.
import javascalautils.{ Either => JEither, Left => JLeft, Right => JRight } val right = asScalaRight(new JRight[String,String]("Left is not Right"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Some to a scala.Some.
Converts a javascalautils.Some to a scala.Some.
import javascalautils.{ None => JNone, Option => JOption, Some => JSome } val optionSome = asScalaOption(new JSome("Some is never None"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Success to a scala.util.Success.
Converts a javascalautils.Success to a scala.util.Success.
import javascalautils.{Try => JTry, Success => JSuccess, Failure => JFailure} val success = asScalaSuccess(new JSuccess("Success is never a Failure"))
The type to be converted
The converted type
1.0
Converts a javascalautils.Try to a scala.util.Try.
Converts a javascalautils.Try to a scala.util.Try.
import javascalautils.{Try => JTry, Success => JSuccess, Failure => JFailure} val trySuccess = asScalaTry(new JSuccess("Success is never a Failure")) val tryFailure = asScalaTry(new JFailure(new Exception("Error, terror")))
The type to be converted
The converted type
1.0
Allows for explicit conversion of the supported data types.
Is an aggregate of the j2s.Converters and s2j.Converters.
Example on usage:
Refer to the various methods on this object for further code examples.
1.0