net.liftweb.common

BoxTrait

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

Attributes
sealed
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. def != (arg0: AnyRef): Boolean

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

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

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

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

    Attributes
    final
    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] with Serializable

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

    Create a Box from the specified Option.

    returns

    a Box created from a Box. Full(x) if the Box is Full(x) and not null Empty otherwise

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

    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. def asInstanceOf [T0] : T0

    Attributes
    final
    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

    Attributes
    implicit
  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

    Attributes
    implicit
  16. def clone (): AnyRef

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

    Attributes
    final
    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. def getClass (): java.lang.Class[_]

    Attributes
    final
    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. def isInstanceOf [T0] : Boolean

    Attributes
    final
    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. def ne (arg0: AnyRef): Boolean

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

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

    Attributes
    final
    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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  31. def toString (): String

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

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

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

    Attributes
    final
    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

    Use legacyNullTest

Inherited from AnyRef

Inherited from Any