Data type representing either successfully computed value or non-empty collection of path-annotated errors.
Type parameters
- A
-
type of success value
Attributes
- See also
- Since
-
0.7.0
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
Returns (possibly empty) collection of tuples with conventional string representation of path and errors message.
Returns (possibly empty) collection of tuples with conventional string representation of path and errors message.
Attributes
- Returns
-
empty scala.collection.Iterable if success, a sequence of pairs (a path to a failed field, an io.scalaland.chimney.partial.ErrorMessage) otherwise
- Since
-
0.7.0
Concrete methods
Converts a partial result to an scala.Either.
Converts a partial result to an scala.Either.
Attributes
- Returns
-
scala.Right if success, scala.Left containing io.scalaland.chimney.partial.Result.Errors otherwise
- Since
-
0.7.0
Converts a partial result to an scala.Either with collection of tuples with conventional string representation of path and string representation of error message as scala.Left.
Converts a partial result to an scala.Either with collection of tuples with conventional string representation of path and string representation of error message as scala.Left.
Attributes
- Returns
-
scala.Right if success, scala.Left containing a sequence of pairs (a path to a failed field, an errors message as java.lang.String otherwise
- Since
-
0.8.5
Converts a partial result to an scala.Either with collection of tuples with conventional string representation of path and errors message as scala.Left.
Converts a partial result to an scala.Either with collection of tuples with conventional string representation of path and errors message as scala.Left.
Attributes
- Returns
-
scala.Right if success, scala.Left containing a sequence of pairs (a path to a failed field, an io.scalaland.chimney.partial.ErrorMessage) otherwise
- Since
-
0.8.5
Returns (possibly empty) collection of tuples with conventional string representation of path and string representation of error message.
Returns (possibly empty) collection of tuples with conventional string representation of path and string representation of error message.
Attributes
- Returns
-
empty scala.collection.Iterable if success, a sequence of pairs (a path to a failed field, an errors message as java.lang.String
- Since
-
0.7.0
Converts a partial result to an optional value.
Converts a partial result to an optional value.
Attributes
- Returns
-
scala.Some if success, scala.None otherwise
- Since
-
0.7.0
Builds a new result by applying a function to a success value and using result returned by that that function.
Builds a new result by applying a function to a success value and using result returned by that that function.
Type parameters
- B
-
the element type of the returned result
Value parameters
- f
-
the function to apply to a success value
Attributes
- Returns
-
a new io.scalaland.chimney.partial.Result built from applying a function to a success value and using the io.scalaland.chimney.partial.Result returned by that function
- Since
-
0.7.0
Builds a new result by flattening the current value.
Builds a new result by flattening the current value.
Type parameters
- B
-
the element type of the returned result
Attributes
- Returns
-
a new io.scalaland.chimney.partial.Result built from applying a function to a success value and using the io.scalaland.chimney.partial.Result returned by that function
- Since
-
0.8.4
Extracts value from a partial result and applies it to the appropriate function.
Extracts value from a partial result and applies it to the appropriate function.
Type parameters
- B
-
the type of the folding
Value parameters
- onErrors
-
the function to apply to errors
- onValue
-
the function to apply to success value
Attributes
- Returns
-
a new value
- Since
-
0.8.5
Builds a new result by applying a function to a success value.
Builds a new result by applying a function to a success value.
Type parameters
- B
-
the element type of the returned result
Value parameters
- f
-
the function to apply to a success value
Attributes
- Returns
-
a new io.scalaland.chimney.partial.Result built from applying a function to a success value
- Since
-
0.7.0
Prepends a io.scalaland.chimney.partial.PathElement to all errors represented by this result.
Prepends a io.scalaland.chimney.partial.PathElement to all errors represented by this result.
Type parameters
- B
-
the element type of the returned result
Value parameters
- result
-
lazy io.scalaland.chimney.partial.Result to compute as a fallback if this one has errors
Attributes
- Returns
-
a io.scalaland.chimney.partial.Result with the first successful value or a failure combining errors from both results
- Since
-
1.0.0
Prepends a io.scalaland.chimney.partial.PathElement to all errors represented by this result.
Prepends a io.scalaland.chimney.partial.PathElement to all errors represented by this result.
Value parameters
- pathElement
-
io.scalaland.chimney.partial.PathElement to be prepended
Attributes
- Returns
-
a io.scalaland.chimney.partial.Result with io.scalaland.chimney.partial.PathElement prepended to all errors
- Since
-
0.7.0
Unseals the io.scalaland.chimney.partial.Path of current io.scalaland.chimney.partial.Error.
Unseals the io.scalaland.chimney.partial.Path of current io.scalaland.chimney.partial.Error.
When derivation is building up the result it automatically appends fields/indices/map keys - however values obtained with withFieldComputed(Partial)(From) contains the whole Path already, so prependErrorPath should be a noop for them.
However, this path can only be precomputed only up to the boundaries of a io.scalaland.chimney.PartialTransformer, and when one transformer calls another, path should be appended again. This method allows this.
Attributes
- Returns
-
error with a path prepended with provided path element
- Since
-
1.6.0