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
List
ofBox
es into a singleBox
containting aList[T]
, whereT
is the parameterized type of theBox
es.Convert a
List
ofBox
es into a singleBox
containting aList[T]
, whereT
is the parameterized type of theBox
es.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
Box
es in theList
areFull
orEmpty
, we return aFull
box containing aList
of all of theFull
Box
values that were present. If any of theBox
es contain aFailure
, aParamFailure
is returned, containing the originalList[Box[T]]
as the param. TheParamFailure
itself is chained to aFailure
chain containing all of theFailure
boxes 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 asEmpty
values 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 noFailure
s were present.ParamFailure[List[Box[T]]]
otherwise.
-
def
toString(): String
- Definition Classes
- Any