implicit class Ops[V] extends AnyRef
Extension methods for Option
- Alphabetic
- By Inheritance
- Ops
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Ops(self: Option[V])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toErr: Result[V, Unit]
Convert an
Option[E]
into aResult[E, Unit]
usingUnit
for theOk
value in theNone
case.Convert an
Option[E]
into aResult[E, Unit]
usingUnit
for theOk
value in theNone
case.Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> None.toErr == Ok.unit true >>> Some(2).toErr Err(2)
-
def
toErrOrElse[T](default: ⇒ T): Result[V, T]
Convert an
Option[E]
into aResult[E, T]
usingdefault
for theOk
value in theNone
case.Convert an
Option[E]
into aResult[E, T]
usingdefault
for theOk
value in theNone
case.Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> None.toErrOrElse(1) Ok(1) >>> Some(2).toErrOrElse(1) Err(2)
-
def
toOk: Result[Unit, V]
Convert an
Option[T]
into aResult[Unit, T]
usingUnit
for theErr
value in theNone
case.Convert an
Option[T]
into aResult[Unit, T]
usingUnit
for theErr
value in theNone
case.Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> None.toOk == Err.unit true >>> Some(2).toOk Ok(2)
-
def
toOkOrElse[E](default: ⇒ E): Result[E, V]
Convert an
Option[T]
into aResult[E, T]
usingdefault
for theErr
value in theNone
case.Convert an
Option[T]
into aResult[E, T]
usingdefault
for theErr
value in theNone
case.Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> None.toOkOrElse(1) Err(1) >>> Some(2).toOkOrElse(1) Ok(2)
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
transposeErr[T, E](implicit ev: <:<[V, Result[E, T]]): Result[Option[E], T]
Convert an
Option[Result[E, T]]
into aResult[E, Option[T]]
with theNone
case being treated as anErr
Convert an
Option[Result[E, T]]
into aResult[E, Option[T]]
with theNone
case being treated as anErr
Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> Some(Err(1)).transposeErr Err(Some(1)) >>> Some(Ok(2)).transposeErr Ok(2) >>> None.transposeErr Err(None)
-
def
transposeOk[T, E](implicit ev: <:<[V, Result[E, T]]): Result[E, Option[T]]
Convert an
Option[Result[E, T]]
into aResult[E, Option[T]]
with theNone
case being treated as anOk
Convert an
Option[Result[E, T]]
into aResult[E, Option[T]]
with theNone
case being treated as anOk
Examples
>>> import dev.jsbrucker.result._ >>> import dev.jsbrucker.result.extensions.option._ >>> Some(Ok(1)).transposeOk Ok(Some(1)) >>> Some(Err(2)).transposeOk Err(2) >>> None.transposeOk Ok(None)
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated