Packages

  • package root

    This library provides the mechanisms to convert between types provided by javascalautils to their Scala equivalence and vice-versa.

    Overview

    This library provides the mechanisms to convert between types provided by javascalautils to their Scala equivalence and vice-versa.
    One can either perform explicit conversions by using a specific converter method or do implicit conversions using the decorator pattern provided by Scalas implicit method declaration.

    Explicit Conversion

    This is the mechanism for performing the conversion by invoking a specific method taking the type you want to and converting it to its Scala or Java equivalence.
    There's converters for Java -> Scala, javascalautils.converters.j2s.Converters as well as from Scala -> Java, javascalautils.converters.s2j.Converters. There's also an aggregate converter containing both of these javascalautils.converters.JavaScalaUtilConverters. Either import the converters you need:

    import javascalautils.converters.j2s.Converters._
    import javascalautils.converters.s2j.Converters._

    or use the aggregate object composed of both above converters

    import javascalautils.converters.JavaScalaUtilConverters._

    After that it's a matter of using the right converter method to do the job.
    E.g.

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

    Refer to the aggregate object javascalautils.converters.JavaScalaUtilConverters for a list of all converter methods and examples on usage.

    Implicit Conversion

    This utilizes the implicit mechanism in Scala to decorate any given class with new methods.
    More precisely this library provides asScala methods on all supported Java types and asJava methods on all supported Scala types.
    This magic is enabled by having the right imports in scope.
    Just as with the explicit converters the implicit ones are divided into Java -> Scala, javascalautils.converters.j2s.Implicits as well as from Scala -> Java, javascalautils.converters.s2j.Implicits.
    Or one can choose to use the aggregate implicit javascalautils.converters.JavaScalaUtilImplicits.
    It's again a matter of having the right imports in scope.

    import javascalautils.converters.j2s.Implicits._
    import javascalautils.converters.s2j.Implicits._

    or use the aggregate object composed of both above implicits.

    import javascalautils.converters.JavaScalaUtilImplicits._

    Now your instances should be decorated with either a asScala or asJava method.

    import javascalautils.{Some => JSome}
    
    val some = new JSome("Some is never None").asScala
    val jsome = Some("Some is never None").asJava

    Full Documentation

    Wiki

    License

    Copyright 2015 Peter Nerg

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and limitations under the License.

    Definition Classes
    root
  • package javascalautils
    Definition Classes
    root
  • package converters

    Contains the main/aggregate objects for the converters and implicits.

    Contains the main/aggregate objects for the converters and implicits.

    Definition Classes
    javascalautils
  • package j2s

    Contains the converters from Java -> Scala, both implicit as well as explicit.

    Contains the converters from Java -> Scala, both implicit as well as explicit.

    Definition Classes
    converters
  • package s2j

    Contains the converters from Scala -> Java, both implicit as well as explicit.

    Contains the converters from Scala -> Java, both implicit as well as explicit.

    Definition Classes
    converters
  • JavaScalaUtilConverters
  • JavaScalaUtilImplicits
o

javascalautils.converters

JavaScalaUtilImplicits

object JavaScalaUtilImplicits extends Implicits with Implicits

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

import javascalautils.converters.JavaScalaUtilImplicits._
import javascalautils.{Some => JSome}
val some = new JSome("Some is never None").asScala
val jsome = Some("Some is never None").asJava
Since

1.0

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JavaScalaUtilImplicits
  2. Implicits
  3. FutureImplicits
  4. EitherImplicits
  5. TryImplicits
  6. OptionImplicits
  7. Implicits
  8. FutureImplicits
  9. EitherImplicits
  10. TryImplicits
  11. OptionImplicits
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. implicit def asJavaEither[L, R](underlying: scala.util.Either[L, R]): EitherDecorator[L, R]

    The implicit definition for decorating the scala.util.Either class.

    The implicit definition for decorating the scala.util.Either class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.util.Failure class.

    The implicit definition for decorating the scala.util.Failure class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.concurrent.Future conversions class.

    The implicit definition for decorating the scala.concurrent.Future conversions class.

    underlying

    The type to be converted

    ec

    The ExecutionContext to use

    returns

    The decorator class

    Definition Classes
    FutureImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.util.Left class.

    The implicit definition for decorating the scala.util.Left class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.None class.

    The implicit definition for decorating the scala.None class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

  10. implicit def asJavaOption[T](underlying: scala.Option[T]): OptionDecorator[T]

    The implicit definition for decorating the scala.Option class.

    The implicit definition for decorating the scala.Option class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.util.Right class.

    The implicit definition for decorating the scala.util.Right class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.Some class.

    The implicit definition for decorating the scala.Some class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.util.Success class.

    The implicit definition for decorating the scala.util.Success class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

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

    The implicit definition for decorating the scala.util.Try class.

    The implicit definition for decorating the scala.util.Try class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

  15. implicit def asScalaEither[L, R](underlying: Either[L, R]): EitherDecorator[L, R]

    The implicit definition for decorating the javascalautils.Either class.

    The implicit definition for decorating the javascalautils.Either class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

  16. implicit def asScalaFailure[T](underlying: Failure[T]): FailureDecorator[T]

    The implicit definition for decorating the javascalautils.Failure class.

    The implicit definition for decorating the javascalautils.Failure class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

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

    The implicit definition for decorating the javascalautils.concurrent.Future class.

    The implicit definition for decorating the javascalautils.concurrent.Future class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    FutureImplicits
    Since

    1.0

  18. implicit def asScalaLeft[L, R](underlying: Left[L, R]): LeftDecorator[L, R]

    The implicit definition for decorating the javascalautils.Left class.

    The implicit definition for decorating the javascalautils.Left class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

  19. implicit def asScalaNone[T](underlying: None[T]): NoneDecorator[T]

    The implicit definition for decorating the javascalautils.None class.

    The implicit definition for decorating the javascalautils.None class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

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

    The implicit definition for decorating the javascalautils.Option class.

    The implicit definition for decorating the javascalautils.Option class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

  21. implicit def asScalaRight[L, R](underlying: Right[L, R]): RightDecorator[L, R]

    The implicit definition for decorating the javascalautils.Right class.

    The implicit definition for decorating the javascalautils.Right class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    EitherImplicits
    Since

    1.0

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

    The implicit definition for decorating the javascalautils.Some class.

    The implicit definition for decorating the javascalautils.Some class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    OptionImplicits
    Since

    1.0

  23. implicit def asScalaSuccess[T](underlying: Success[T]): SuccessDecorator[T]

    The implicit definition for decorating the javascalautils.Success class.

    The implicit definition for decorating the javascalautils.Success class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

  24. implicit def asScalaTry[T](underlying: Try[T]): TryDecorator[T]

    The implicit definition for decorating the javascalautils.Try class.

    The implicit definition for decorating the javascalautils.Try class.

    underlying

    The type to be converted

    returns

    The decorator class

    Definition Classes
    TryImplicits
    Since

    1.0

  25. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): scala.Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. final def notifyAll(): scala.Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(arg0: Long, arg1: Int): scala.Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): scala.Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  38. final def wait(): scala.Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): scala.Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Implicits

Inherited from FutureImplicits

Inherited from EitherImplicits

Inherited from TryImplicits

Inherited from OptionImplicits

Inherited from Implicits

Inherited from FutureImplicits

Inherited from EitherImplicits

Inherited from TryImplicits

Inherited from OptionImplicits

Inherited from AnyRef

Inherited from Any

Ungrouped