Companion to io.scalaland.chimney.partial.Result.
Attributes
Members list
Type members
Classlikes
Success value case representation.
Success value case representation.
Type parameters
- A
-
type of success value
Value parameters
- value
-
value of type
A
Attributes
- Since
-
0.7.0
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Result[A]class Objecttrait Matchableclass AnyShow all
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Converts possibly throwing computation into io.scalaland.chimney.partial.Result.
Converts possibly throwing computation into io.scalaland.chimney.partial.Result.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
computation to run while catching its Exceptions
Attributes
- Returns
-
successful io.scalaland.chimney.partial.Result.Value if computation didn't throw, failed io.scalaland.chimney.partial.Result.Errors with caught Exception if it threw
- Since
-
0.7.0
Converts possibly throwing computation into io.scalaland.chimney.partial.Result by catching only NonFatal Exceptions.
Converts possibly throwing computation into io.scalaland.chimney.partial.Result by catching only NonFatal Exceptions.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
computation to run while catching its NonFatal Exceptions
Attributes
- Returns
-
successful io.scalaland.chimney.partial.Result.Value if computation didn't throw, failed io.scalaland.chimney.partial.Result.Errors with caught Exception if it threw
- Since
-
1.5.0
Converts Either to io.scalaland.chimney.partial.Result, using Errors from Left as failed result.
Converts Either to io.scalaland.chimney.partial.Result, using Errors from Left as failed result.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
Either to convert
Attributes
- Returns
-
successful result if scala.Right, failed result if scala.Left
- Since
-
0.7.0
Converts Either to io.scalaland.chimney.partial.Result, using an error message from Left as failed result.
Converts Either to io.scalaland.chimney.partial.Result, using an error message from Left as failed result.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
Either to convert
Attributes
- Returns
-
successful result if scala.Right, failed result with an error message if scala.Left
- Since
-
0.7.0
Creates failed Result with an empty value error.
Creates failed Result with an empty value error.
Type parameters
- A
-
type of successful result
Attributes
- Returns
-
failed io.scalaland.chimney.partial.Result.Errors containing one io.scalaland.chimney.partial.Error.fromEmptyValue
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from a single error.
Creates failed io.scalaland.chimney.partial.Result from a single error.
Type parameters
- A
-
type of successful result
Value parameters
- error
-
required error
Attributes
- Returns
-
failed io.scalaland.chimney.partial.Result.Errors containing one io.scalaland.chimney.partial.Error
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from argument for which PartialFunction was not defined.
Creates failed io.scalaland.chimney.partial.Result from argument for which PartialFunction was not defined.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
value for which partial function was not defined
Attributes
- Returns
-
result containing one error
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from an error message.
Creates failed io.scalaland.chimney.partial.Result from an error message.
Type parameters
- A
-
type of successful result
Value parameters
- message
-
message to wrap in Error
Attributes
- Returns
-
result containing one error
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from one error message or more.
Creates failed io.scalaland.chimney.partial.Result from one error message or more.
Type parameters
- A
-
type of successful result
Value parameters
- message
-
required message to wrap in Error
- messages
-
optional messages to wrap in Error
Attributes
- Returns
-
result aggregating all passed errors
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from Exception that was caught.
Creates failed io.scalaland.chimney.partial.Result from Exception that was caught.
Type parameters
- W
-
type of successful result
Value parameters
- throwable
-
exception
Attributes
- Returns
-
result containing one error
- Since
-
0.7.0
Creates failed io.scalaland.chimney.partial.Result from one error or more.
Creates failed io.scalaland.chimney.partial.Result from one error or more.
Type parameters
- A
-
type of successful result
Value parameters
- error
-
required head io.scalaland.chimney.partial.Error
- errors
-
optional tail io.scalaland.chimney.partial.Errors
Attributes
- Returns
-
failed io.scalaland.chimney.partial.Result.Errors aggregating all passed io.scalaland.chimney.partial.Errors
- Since
-
0.7.0
Converts a function that throws Exceptions into function that returns io.scalaland.chimney.partial.Result.
Converts a function that throws Exceptions into function that returns io.scalaland.chimney.partial.Result.
Type parameters
- A
-
input type
- B
-
output type
Value parameters
- f
-
function that possibly throws
Attributes
- Returns
-
function that catches Exceptions as io.scalaland.chimney.partial.Result.Errors
- Since
-
0.7.0
Converts Option to io.scalaland.chimney.partial.Result, using EmptyValue error if None.
Converts Option to io.scalaland.chimney.partial.Result, using EmptyValue error if None.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
Option to convert
Attributes
- Returns
-
successful result if scala.Some, failed result with EmptyValue error if None
- Since
-
0.7.0
Converts Option to io.scalaland.chimney.partial.Result, using provided Error if None.
Converts Option to io.scalaland.chimney.partial.Result, using provided Error if None.
Type parameters
- A
-
type of successful result
Value parameters
- ifEmpty
-
lazy error for scala.None
- value
-
Option to convert
Attributes
- Returns
-
successful result if scala.Some, failed result with provided error if scala.None
- Since
-
0.7.0
Converts Option to io.scalaland.chimney.partial.Result, using provided error message if None.
Converts Option to io.scalaland.chimney.partial.Result, using provided error message if None.
Type parameters
- A
-
type of successful result
Value parameters
- ifEmpty
-
lazy error message for scala.None
- value
-
scala.Option to convert
Attributes
- Returns
-
successful result if scala.Some, failed result with provided error message if scala.None
- Since
-
0.7.0
Converts Option to Result, using provided Throwable if None.
Converts Option to Result, using provided Throwable if None.
Type parameters
- A
-
type of successful result
Value parameters
- ifEmpty
-
lazy error for scala.None
- value
-
Option to convert
Attributes
- Returns
-
successful result if scala.Some, failed result with provided Throwable if scala.None
- Since
-
0.7.0
Converts a partial function that throws Exceptions into function that returns io.scalaland.chimney.partial.Result.
Converts a partial function that throws Exceptions into function that returns io.scalaland.chimney.partial.Result.
Type parameters
- A
-
input type
- B
-
output type
Value parameters
- pf
-
partial function that possibly throws
Attributes
- Returns
-
function that catches Exceptions and arguments without defined value as io.scalaland.chimney.partial.Result.Errors
- Since
-
0.7.0
Converts Try to io.scalaland.chimney.partial.Result, using Throwable from Failure as failed result.
Converts Try to io.scalaland.chimney.partial.Result, using Throwable from Failure as failed result.
Type parameters
- A
-
type of successful result
Value parameters
- value
-
scala.util.Try to convert
Attributes
- Returns
-
successful result if scala.util.Success, failed result with Throwable if scala.util.Failure
- Since
-
0.7.0
Creates successful io.scalaland.chimney.partial.Result from a precomputed value.
Creates successful io.scalaland.chimney.partial.Result from a precomputed value.
Type parameters
- A
-
type of successful value
Value parameters
- value
-
successful value to return in result
Attributes
- Returns
-
successful io.scalaland.chimney.partial.Result.Value
- Since
-
0.7.0
Combines 2 io.scalaland.chimney.partial.Results into 1 by combining their successful values or aggregating errors.
Combines 2 io.scalaland.chimney.partial.Results into 1 by combining their successful values or aggregating errors.
Type parameters
- A
-
first successful input type
- B
-
second successful input type
- C
-
successful output type
Value parameters
- f
-
function combining 2 successful input values into successful output value
- failFast
-
whether conversion should stop at first failed element or should it aggregate errors from both Results
- resultA
-
first Result
- resultB
-
second Result
Attributes
- Returns
-
successful io.scalaland.chimney.partial.Result.Value of combination if both io.scalaland.chimney.partial.Results were successful, failed io.scalaland.chimney.partial.Result.Errors if at least one of io.scalaland.chimney.partial.Results were failure
- Since
-
0.7.0
Combines 2 io.scalaland.chimney.partial.Results into 1 by tupling their successful values or aggregating errors.
Combines 2 io.scalaland.chimney.partial.Results into 1 by tupling their successful values or aggregating errors.
Type parameters
- A
-
first successful input type
- B
-
second successful input type
Value parameters
- failFast
-
whether conversion should stop at first failed element or should it aggregate errors from both io.scalaland.chimney.partial.Results
- resultA
- resultB
Attributes
- Returns
-
successful io.scalaland.chimney.partial.Result.Value with a tuple if both io.scalaland.chimney.partial.Results were successful, failed io.scalaland.chimney.partial.Result.Errors if at least one of io.scalaland.chimney.partial.Result were failure
- Since
-
0.7.0
Converts an scala.collection.Iterator containing io.scalaland.chimney.partial.Results into a io.scalaland.chimney.partial.Result with selected collection of successful values.
Converts an scala.collection.Iterator containing io.scalaland.chimney.partial.Results into a io.scalaland.chimney.partial.Result with selected collection of successful values.
Type parameters
- A
-
type of successful values in Results
- M
-
type of output - output collection of output element
Value parameters
- fac
-
factory of output type
- failFast
-
whether conversion should stop at first failed element conversion or should it continue to aggregate all errors
- it
-
iterator with Results to aggregate
Attributes
- Returns
-
result with user-selected collection of converted elements if all conversions succeeded, result with conversion errors if at least one conversion failed
- Since
-
0.7.0
Converts an scala.collection.Iterator of input type into selected collection of output type, aggregating errors from conversions of individual elements.
Converts an scala.collection.Iterator of input type into selected collection of output type, aggregating errors from conversions of individual elements.
Type parameters
- A
-
type of elements of input
- B
-
type of elements of output
- M
-
type of output - output collection of output element
Value parameters
- f
-
function converting each individual element to Result
- fac
-
factory of output type
- failFast
-
whether conversion should stop at first failed element conversion or should it continue to aggregate all errors
- it
-
iterator with elements to convert
Attributes
- Returns
-
io.scalaland.chimney.partial.Result.Value with user-selected collection of converted elements if all conversions succeeded, io.scalaland.chimney.partial.Result.Errors with conversion errors if at least one conversion failed
- Since
-
0.7.0