implicit final class ListOfBoxes[T] extends AnyVal
Helper class to provide an easy way for converting a List[Box[T]] into
a Box[List[T]].
- Alphabetic
- By Inheritance
- ListOfBoxes
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val theListOfBoxes: List[Box[T]]
-
def
toSingleBox(failureErrorMessage: String): Box[List[T]]
Convert a
ListofBoxes into a singleBoxcontainting aList[T], whereTis the parameterized type of theBoxes.Convert a
ListofBoxes into a singleBoxcontainting aList[T], whereTis the parameterized type of theBoxes.This method is useful for those cases where you have a lot of operations being executed that all return some
Box[T]. You want just aList[T]if all of those operations succeeded, but you don't want to have Failures disappear if any were present in the list.If all of the
Boxes in theListareFullorEmpty, we return aFullbox containing aListof all of theFullBoxvalues that were present. If any of theBoxes contain aFailure, aParamFailureis returned, containing the originalList[Box[T]]as the param. TheParamFailureitself is chained to aFailurechain containing all of theFailureboxes in the list.It is worth noting that the size of the list in the resulting
Box[List[T]]may not be equal to the size of theList[Box[T]]that is fed asEmptyvalues will disappear altogether in the conversion.- failureErrorMessage
The string that should be placed in the message for the Failure.
- returns
A
Full[List[T]]if noFailures were present.ParamFailure[List[Box[T]]]otherwise.
-
def
toString(): String
- Definition Classes
- Any