net.liftweb.common

BoxTrait

sealed trait BoxTrait extends AnyRef

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

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

Value Members

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

    Alias for legacyNullTest.

    Alias for legacyNullTest. This method allows one to encapsulate any object in a Box in a null-safe manner, returning Empty if the specified value is null.

    returns

    Full(in) if in is not null Empty otherwise

  2. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  3. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. 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 Box; if the pf is undefined at that point return Empty.

    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.

    value

    the value to transform

    pf

    the partial function to use to transform the value

    returns

    a Full box containing the transformed value if pf.isDefinedAt(value); Empty otherwise

  8. 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 Box; if the pf is undefined at that point return Empty.

    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.

    pf

    the partial function to use to transform the value

    value

    the value to transform

    returns

    a Full box containing the transformed value if pf.isDefinedAt(value); Empty otherwise

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

    Transform a List with zero or one elements to a Box.

    Transform a List with zero or one elements to a Box.

    returns

    a Box object containing the head of a List. Full(x) if the List contains at least one element and Empty otherwise.

  10. 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(x) if in is Full(x) and x is not null Empty otherwise

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

    Create a Box from the specified Option.

    Create a Box from the specified Option.

    returns

    a Box created from an Option. Full(x) if the Option is Some(x) and Empty otherwise

  12. 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; Empty otherwise.

  13. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  14. implicit def box2Iterable[T](in: Box[T]): Iterable[T]

    This implicit transformation allows one to use a Box as an Iterable

    This implicit transformation allows one to use a Box as an Iterable

    returns

    List(in) if this Box is Full(in); Nil otherwise

  15. 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.

    returns

    Some(in) if this Box is Full(in); None otherwise

  16. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. 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, or Empty otherwise.

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def legacyNullTest[T](in: T): Box[T]

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

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

    returns

    Full(in) if in is not null; Empty otherwise

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. 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

    a Box object from an Option. Full(in) if the Option is Some(in); Empty otherwise

  29. val primativeMap: Map[Class[_], Class[_]]

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

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

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

    This method allows one to encapsulate any object in a Box in a null-safe manner, treating null values to Empty. This is a parallel method to the Scala Option's apply method. Note that the apply method is overloaded and it's much, much better to use legacyNullTest in this case.

    returns

    Full(in) if in is not null; Empty otherwise

    Annotations
    @deprecated
    Deprecated

    (Since version 2.5) Use legacyNullTest

Inherited from AnyRef

Inherited from Any