sealed trait BoxTrait extends OptionImplicits
- Alphabetic
- By Inheritance
- BoxTrait
- OptionImplicits
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
!: Box[T]
Alias for
legacyNullTest. -
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
-
def
apply[InType, OutType](value: InType)(pf: PartialFunction[InType, OutType]): Box[OutType]
Apply the specified
PartialFunctionto the specifiedvalueand return the result in aFull; if thepfis not defined at that point returnEmpty.Apply the specified
PartialFunctionto the specifiedvalueand return the result in aFull; if thepfis not defined at that point returnEmpty.- value
The value to transform.
- pf
The partial function to use to transform the value.
- returns
A
Fullcontaining the transformed value ifpf.isDefinedAt(value)andEmptyotherwise.
-
def
apply[InType, OutType](pf: PartialFunction[InType, OutType])(value: InType): Box[OutType]
Apply the specified
PartialFunctionto the specifiedvalueand return the result in aFull; if thepfis not defined at that point returnEmpty.Apply the specified
PartialFunctionto the specifiedvalueand return the result in aFull; if thepfis not defined at that point returnEmpty.- pf
The partial function to use to transform the value.
- value
The value to transform.
- returns
A
Fullcontaining the transformed value ifpf.isDefinedAt(value)andEmptyotherwise.
-
def
apply[T](in: List[T]): Box[T]
Transform a
Listwith zero or more elements to aBox, losing all but the first element if there are more than one.Transform a
Listwith zero or more elements to aBox, losing all but the first element if there are more than one.- returns
Full(x)with the head of the list if it contains at least one element andEmptyotherwise.
-
def
apply[T](in: Box[T]): Box[T]
Create a
Boxfrom the specifiedBox, checking fornull.Create a
Boxfrom the specifiedBox, checking fornull.- returns
Full(in)ifinis aFullbox and its value is non-null,Emptyotherwise.
-
def
apply[T](in: Option[T]): Box[T]
Create a
Boxfrom the specifiedOption.Create a
Boxfrom the specifiedOption.- returns
Fullwith the contents if theOptionisSomeandEmptyotherwise.
-
def
asA[B](in: T forSome {type T})(implicit m: Manifest[B]): Box[B]
Create a
Fullbox containing the specified value ifinis of typeBandEmptyotherwise.Create a
Fullbox containing the specified value ifinis of typeBandEmptyotherwise.For example:
scala> Box.asA[Int]("boom") res0: net.liftweb.common.Box[Int] = Empty scala> Box.asA[Int](5) res1: net.liftweb.common.Box[Int] = Full(5)
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
def
box2Iterable[T](in: Box[T]): Iterable[T]
This implicit transformation allows one to use a
Boxas anIterableof zero or one elements.This implicit transformation allows one to use a
Boxas anIterableof zero or one elements.- returns
A single-element
Listwith the contents if the box isFullandNilotherwise.
-
implicit
def
box2Option[T](in: Box[T]): Option[T]
This implicit transformation allows one to use a
Boxas anOption.This implicit transformation allows one to use a
Boxas anOption.Note that
Boximplementsgetspecifically to avoid usage of.getonBoxinstances. Boxes should be opened usingopenOrThrowExceptionand their contents compared using== Full(expectedValue).- returns
Somewith the contents if the box isFullandNoneotherwise.
- Definition Classes
- OptionImplicits
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isA[A, B](in: A, clz: Class[B]): Box[B]
Create a
Fullbox containing the specified value ifinis an instance of the specified classclzandEmptyotherwise.Create a
Fullbox containing the specified value ifinis an instance of the specified classclzandEmptyotherwise.This is basically a Java-friendly version of
asA, which you should prefer when using Scala.For example:
scala> Box.isA("boom", classOf[Int]) res0: net.liftweb.common.Box[Int] = Empty scala> Box.isA(5, classOf[Int]) res1: net.liftweb.common.Box[Int] = Full(5)
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
legacyNullTest[T](in: T): Box[T]
This method allows one to encapsulate any object in a Box in a null-safe manner, converting
nullvalues toEmpty.This method allows one to encapsulate any object in a Box in a null-safe manner, converting
nullvalues toEmpty.- returns
Fullifinis not null andEmptyotherwise.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
implicit
def
option2Box[T](in: Option[T]): Box[T]
This implicit transformation allows one to use an
Optionas aBox.This implicit transformation allows one to use an
Optionas aBox.- returns
Fullwith the contents if theOptionisSomeandEmptyotherwise.
- Definition Classes
- OptionImplicits
- val primitiveMap: Map[Class[_], Class[_]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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()
Deprecated Value Members
-
val
primativeMap: Map[Class[_], Class[_]]
- Annotations
- @deprecated
- Deprecated
(Since version 3.0) Use the correctly-spelled primitiveMap instead.