c

jshelpers

JsUndefOrOps

final class JsUndefOrOps[A] extends UndefOrCommon[A]

Note that js.UndefOr and js.| already have a .orNull method.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsUndefOrOps
  2. UndefOrCommon
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsUndefOrOps(a: UndefOr[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. def !?[B >: A](default: => B): B

    Same as .getOrElse just shorter.

    Same as .getOrElse just shorter.

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()
  3. final def ##: Int
    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def ??[B >: A](default: => B): B

    Same as .getOrElse just shorter.

    Same as .getOrElse just shorter.

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()
  6. val a: UndefOr[A]
    Definition Classes
    JsUndefOrOpsUndefOrCommon
  7. def as[B]: UndefOr[B]

    Changes what's inside but preserves UndefOr.

    Changes what's inside but preserves UndefOr.

    Definition Classes
    UndefOrCommon
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def filterNull: UndefOr[A]

    null => undefined, else the value remains.

    null => undefined, else the value remains.

    Definition Classes
    UndefOrCommon
  13. def filterTruthy: UndefOr[A]

    Keep the value if its truthy, otherwise return undefined.

    Keep the value if its truthy, otherwise return undefined.

    Definition Classes
    UndefOrCommon
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def isNull: Boolean

    Tests for overall nullness which is different than .isEmpty|.nonEmpty.

    Tests for overall nullness which is different than .isEmpty|.nonEmpty.

    Definition Classes
    UndefOrCommon
  18. def isTotalEmpty: Boolean

    This may override UndefOr.isEmpty but this checks for null as well.

    This may override UndefOr.isEmpty but this checks for null as well.

    Definition Classes
    UndefOrCommon
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toNonNullOption: Option[A]

    This could also be _.toOption.filter(_ != null) but below is slightly faster.

    This could also be _.toOption.filter(_ != null) but below is slightly faster.

    Definition Classes
    UndefOrCommon
  24. def toNull: |[A, Null]

    Convert UndefOr[A] => A|Null

    Convert UndefOr[A] => A|Null

    Definition Classes
    UndefOrCommon
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. def toStringJs: String

    Calls toString.

    Calls toString. I'm not sure this is needed at all.

    Definition Classes
    UndefOrCommon
  27. def toTruthy: Boolean

    Equivalent to !!someJSValue

    Equivalent to !!someJSValue

    Definition Classes
    UndefOrCommon
  28. def toUndefOrNull: UndefOr[|[A, Null]]

    Uh-oh, thought it was js.UndefOr[A] but you need to say its a js.UndefOr[A|Null] because the docs were wrong :-).

    Uh-oh, thought it was js.UndefOr[A] but you need to say its a js.UndefOr[A|Null] because the docs were wrong :-).

    Definition Classes
    UndefOrCommon
    Annotations
    @inline()
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from UndefOrCommon[A]

Inherited from AnyRef

Inherited from Any

Ungrouped