Object

javascalautils.converters

JavaScalaUtilConverters

Related Doc: package converters

Permalink

object JavaScalaUtilConverters extends Converters with Converters

Allows for explicit conversion of the supported data types.
Is an aggregate of the j2s.Converters and s2j.Converters.
Example on usage:

import javascalautils.converters.JavaScalaUtilConverters._
import javascalautils.{Some => JSome}
val optionSome = asScalaOption(new JSome("Some is never None"))
val joptionSome = asJavaOption(Some("Some is never None"))

Refer to the various methods on this object for further code examples.

Since

1.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JavaScalaUtilConverters
  2. Converters
  3. FutureConverters
  4. EitherConverters
  5. TryConverters
  6. OptionConverters
  7. Converters
  8. FutureConverters
  9. EitherConverters
  10. TryConverters
  11. OptionConverters
  12. AnyRef
  13. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def asJavaEither[L, R](underlying: scala.util.Either[L, R]): Either[_ <: L, _ <: R] with Serializable

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  6. def asJavaFailure[T](underlying: scala.util.Failure[T]): Failure[Nothing]

    Permalink

    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!!!")))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  7. def asJavaFuture[T](underlying: Future[T])(implicit ec: ExecutionContext): Future[T]

    Permalink

    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)
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    FutureConverters
    Since

    1.0

  8. def asJavaLeft[L, R](underlying: scala.util.Left[L, R]): Left[L, Nothing]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  9. def asJavaNone[T](underlying: scala.None.type): None[Nothing]

    Permalink

    Converts a scala.None to a javascalautils.None.

    Converts a scala.None to a javascalautils.None.

    val jnone = asJavaNone(None)
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  10. def asJavaOption[T](underlying: scala.Option[T]): Option[_ <: T] with Serializable

    Permalink

    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)
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  11. def asJavaRight[L, R](underlying: scala.util.Right[L, R]): Right[Nothing, R]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  12. def asJavaSome[T](underlying: scala.Some[T]): Some[T]

    Permalink

    Converts a scala.Some to a javascalautils.Some.

    Converts a scala.Some to a javascalautils.Some.

    val jsome = asJavaSome(Some("Some is never None"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  13. def asJavaSuccess[T](underlying: scala.util.Success[T]): Success[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  14. def asJavaTry[T](underlying: scala.util.Try[T]): Try[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  15. def asScalaEither[L, R](underlying: Either[L, R]): Product with Serializable with scala.util.Either[L, R]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  16. def asScalaFailure[T](underlying: Failure[T]): scala.util.Failure[Nothing]

    Permalink

    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")))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  17. def asScalaFuture[T](underlying: Future[T]): Future[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    FutureConverters
    Since

    1.0

  18. def asScalaLeft[L, R](underlying: Left[L, R]): scala.util.Left[L, Nothing]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  19. def asScalaNone[T](underlying: None[T]): scala.None.type

    Permalink

    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())
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  20. def asScalaOption[T](underlying: Option[T]): scala.Option[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  21. def asScalaRight[L, R](underlying: Right[L, R]): scala.util.Right[Nothing, R]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    EitherConverters
    Since

    1.0

  22. def asScalaSome[T](underlying: Some[T]): scala.Some[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    OptionConverters
    Since

    1.0

  23. def asScalaSuccess[T](underlying: Success[T]): scala.util.Success[T]

    Permalink

    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"))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  24. def asScalaTry[T](underlying: Try[T]): Product with Serializable with scala.util.Try[T]

    Permalink

    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")))
    underlying

    The type to be converted

    returns

    The converted type

    Definition Classes
    TryConverters
    Since

    1.0

  25. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Converters

Inherited from FutureConverters

Inherited from EitherConverters

Inherited from TryConverters

Inherited from OptionConverters

Inherited from Converters

Inherited from FutureConverters

Inherited from EitherConverters

Inherited from TryConverters

Inherited from OptionConverters

Inherited from AnyRef

Inherited from Any

Ungrouped