t

net.liftweb.common

BoxTrait

sealed trait BoxTrait extends AnyRef

Implementation for the Box singleton.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BoxTrait
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def !![T](in: T): Box[T]

    Alias for legacyNullTest.

  2. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def apply[InType, OutType](value: InType)(pf: PartialFunction[InType, OutType]): Box[OutType]

    Apply the specified PartialFunction to the specified value and return the result in a Full; if the pf is not defined at that point return Empty.

    Apply the specified PartialFunction to the specified value and return the result in a Full; if the pf is not defined at that point return Empty.

    value

    The value to transform.

    pf

    The partial function to use to transform the value.

    returns

    A Full containing the transformed value if pf.isDefinedAt(value) and Empty otherwise.

  6. def apply[InType, OutType](pf: PartialFunction[InType, OutType])(value: InType): Box[OutType]

    Apply the specified PartialFunction to the specified value and return the result in a Full; if the pf is not defined at that point return Empty.

    Apply the specified PartialFunction to the specified value and return the result in a Full; if the pf is not defined at that point return Empty.

    pf

    The partial function to use to transform the value.

    value

    The value to transform.

    returns

    A Full containing the transformed value if pf.isDefinedAt(value) and Empty otherwise.

  7. def apply[T](in: List[T]): Box[T]

    Transform a List with zero or more elements to a Box, losing all but the first element if there are more than one.

    Transform a List with zero or more elements to a Box, 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 and Empty otherwise.

  8. def apply[T](in: Box[T]): Box[T]

    Create a Box from the specified Box, checking for null.

    Create a Box from the specified Box, checking for null.

    returns

    Full(in) if in is a Full box and its value is non-null, Empty otherwise.

  9. def apply[T](in: Option[T]): Box[T]

    Create a Box from the specified Option.

    Create a Box from the specified Option.

    returns

    Full with the contents if the Option is Some and Empty otherwise.

  10. def asA[B](in: T forSome {type T})(implicit m: Manifest[B]): Box[B]

    Create a Full box containing the specified value if in is of type B and Empty otherwise.

    Create a Full box containing the specified value if in is of type B and Empty otherwise.

    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)
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. implicit def box2Iterable[T](in: Box[T]): Iterable[T]

    This implicit transformation allows one to use a Box as an Iterable of zero or one elements.

    This implicit transformation allows one to use a Box as an Iterable of zero or one elements.

    returns

    A single-element List with the contents if the box is Full and Nil otherwise.

  13. implicit def box2Option[T](in: Box[T]): Option[T]

    This implicit transformation allows one to use a Box as an Option.

    This implicit transformation allows one to use a Box as an Option.

    Note that Box implements get specifically to avoid usage of .get on Box instances. Boxes should be opened using openOrThrowException and their contents compared using == Full(expectedValue).

    returns

    Some with the contents if the box is Full and None otherwise.

  14. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  20. def isA[A, B](in: A, clz: Class[B]): Box[B]

    Create a Full box containing the specified value if in is an instance of the specified class clz and Empty otherwise.

    Create a Full box containing the specified value if in is an instance of the specified class clz and Empty otherwise.

    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)
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def legacyNullTest[T](in: T): Box[T]

    This method allows one to encapsulate any object in a Box in a null-safe manner, converting null values to Empty.

    This method allows one to encapsulate any object in a Box in a null-safe manner, converting null values to Empty.

    returns

    Full if in is not null and Empty otherwise.

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  26. implicit def option2Box[T](in: Option[T]): Box[T]

    This implicit transformation allows one to use an Option as a Box.

    This implicit transformation allows one to use an Option as a Box.

    returns

    Full with the contents if the Option is Some and Empty otherwise.

  27. val primitiveMap: Map[Class[_], Class[_]]
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. val primativeMap: Map[Class[_], Class[_]]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Use the correctly-spelled primitiveMap instead.

Inherited from AnyRef

Inherited from Any

Ungrouped