final class OptionOps[A] extends AnyVal
- Alphabetic
- By Inheritance
- OptionOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
forEmpty(sideEffect: ⇒ Unit): Option[A]
Apply side effect only if Option is empty.
Apply side effect only if Option is empty. It's a bit like foreach for None
- sideEffect
- code to be executed if option is empty
- returns
the same option
captionOpt.forEmpty(logger.warn("caption is empty")).foreach(setCaption)
Example: -
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def toNOpt: commons.NOpt[A]
-
def
toOpt: commons.Opt[A]
Converts this
Option
intoOpt
.Converts this
Option
intoOpt
. BecauseOpt
cannot holdnull
,Some(null)
is translated toOpt.Empty
. -
def
toOptArg: commons.OptArg[A]
Converts this
Option
intoOptArg
.Converts this
Option
intoOptArg
. BecauseOptArg
cannot holdnull
,Some(null)
is translated toOptArg.Empty
. -
def
toOptRef[B >: Null](implicit boxing: Boxing[A, B]): commons.OptRef[B]
Converts this
Option
intoOptRef
, changing the element type into boxed representation if necessary (e.g.Converts this
Option
intoOptRef
, changing the element type into boxed representation if necessary (e.g.Boolean
intojava.lang.Boolean
). BecauseOptRef
cannot holdnull
,Some(null)
is translated toOptRef.Empty
. -
def
toString(): String
- Definition Classes
- Any