net.liftweb.common.Box

object Box

object Box

 extends ScalaObject


The Box companion object provides methods to create a Box from: It also provides implicit methods to transform Option to Box, Box to Iterable, and Box to Option


Companion: Box

Source: Box.scala(32)

 Constructors

def this

 Methods

!!.. def !![T](in : T)
Alias for legacyNullTest [details]
This method allows one to encapsulate any object in a Box in a null-safe manner, returning Empty if the specified value is null.
return
- Full(in) if in is not null Empty otherwise
Box[T]
!=.. final def !=(arg0 : Object) Boolean AnyRef
!=.. final def !=(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Object) Boolean AnyRef
apply.. def apply[T](in : T)
This method allows one to encapsulate any object in a Box in a null-safe manner, treating null values to Empty [details]
This is a parallel method to the Scala Option's apply method.
return
- Full(in) if in is not null; Empty otherwise
Box[T]
apply.. def apply[InType, OutType](value : InType)(pf : PartialFunction[InType, OutType])
Apply the specified PartialFunction to the specified value and return the result in a Full Box; if the pf is undefined at that point return Empty [details]
param
value - the value to transform
pf - the partial function to use to transform the value
return
- a Full box containing the transformed value if pf.isDefinedAt(value); Empty otherwise
Box[OutType]
apply.. def apply[T](in : Box[T])
Create a Box from the specified Option [details]
return
- a Box created from a Box. Full(x) if the Box is Full(x) and not null Empty otherwise
Box[T]
apply.. def apply[T](in : List[T])
Transform a List with zero or one elements to a Box [details]
return
- a Box object containing the head of a List. Full(x) if the List contains at least one element and Empty otherwise.
Box[T]
apply.. def apply[InType, OutType](pf : PartialFunction[InType, OutType])(value : InType)
Apply the specified PartialFunction to the specified value and return the result in a Full Box; if the pf is undefined at that point return Empty [details]
param
value - the value to transform
pf - the partial function to use to transform the value
return
- a Full box containing the transformed value if pf.isDefinedAt(value); Empty otherwise
Box[OutType]
apply.. def apply[T](in : Option[T])
Create a Box from the specified Option [details]
return
- a Box created from an Option. Full(x) if the Option is Some(x) and Empty otherwise
Box[T]
asA.. def asA[B](in : T)(implicit m : Manifest[B])
Create a Full box containing the specified value if in is of type B; Empty otherwise
Box[B]
asInstanceOf.. final def asInstanceOf[T0] T0 Any
box2Iterable.. implicit def box2Iterable[T](in : Box[T])
This implicit transformation allows one to use a Box as an Iterable [details]
return
- List(in) if this Box is Full(in); Nil otherwise
Iterable[T]
box2Option.. implicit def box2Option[T](in : Box[T])
This implicit transformation allows one to use a Box as an Option [details]
return
- Some(in) if this Box is Full(in); None otherwise
Option[T]
clone.. protected def clone Object AnyRef
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
finalize.. protected def finalize Unit AnyRef
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isA.. def isA[A, B](in : A, clz : Class[B])
Create a Full box containing the specified value if "in" is an instance of the specified class, or Empty otherwise
Box[B]
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
legacyNullTest.. def legacyNullTest[T](in : T)
This method allows one to encapsulate any object in a Box in a null-safe manner, treating null values to Empty [details]
return
- Full(in) if in is not null; Empty otherwise
Box[T]
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
option2Box.. implicit def option2Box[T](in : Option[T])
This implicit transformation allows one to use an Option as a Box [details]
return
- a Box object from an Option. Full(in) if the Option is Some(in); Empty otherwise
Box[T]
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.