sealed trait Result[+A] extends AnyRef
Data type representing either successfully computed value or non-empty collection of path-annotated errors.
- A
type of success value
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#total-transformers-vs-partialtransformers
- Alphabetic
- By Inheritance
- Result
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
asErrorPathMessages: Iterable[(String, ErrorMessage)]
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.
- 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 Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asEither: Either[Errors, A]
Converts a partial result to an scala.Either.
Converts a partial result to an scala.Either.
- returns
scala.Right if success, scala.Left containing io.scalaland.chimney.partial.Result.Errors otherwise
- Since
0.7.0
-
final
def
asEitherErrorPathMessageStrings: Either[Iterable[(String, String)], A]
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.
- 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
-
final
def
asEitherErrorPathMessages: Either[Iterable[(String, ErrorMessage)], A]
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.
- 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
-
final
def
asErrorPathMessageStrings: Iterable[(String, String)]
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.
- 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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
asOption: Option[A]
Converts a partial result to an optional value.
Converts a partial result to an optional value.
- returns
scala.Some if success, scala.None otherwise
- Since
0.7.0
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flatMap[B](f: (A) ⇒ Result[B]): Result[B]
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.
- B
the element type of the returned result
- f
the function to apply to a success value
- 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
-
final
def
flatten[B](implicit ev: <:<[A, Result[B]]): Result[B]
Builds a new result by flattening the current value.
Builds a new result by flattening the current value.
- B
the element type of the returned result
- 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
-
final
def
fold[B](onValue: (A) ⇒ B, onErrors: (Errors) ⇒ B): B
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.
- B
the type of the folding
- onValue
the function to apply to success value
- onErrors
the function to apply to errors
- returns
a new value
- Since
0.8.5
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
map[B](f: (A) ⇒ B): Result[B]
Builds a new result by applying a function to a success value.
Builds a new result by applying a function to a success value.
- B
the element type of the returned result
- f
the function to apply to a success value
- returns
a new io.scalaland.chimney.partial.Result built from applying a function to a success value
- Since
0.7.0
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
orElse[B >: A](result: ⇒ Result[B]): Result[B]
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.
- B
the element type of the returned result
- result
lazy io.scalaland.chimney.partial.Result to compute as a fallback if this one has errors
- returns
a io.scalaland.chimney.partial.Result with the first successful value or a failure combining errors from both results
- Since
1.0.0
-
final
def
prependErrorPath(pathElement: ⇒ PathElement): Result.this.type
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.
- pathElement
io.scalaland.chimney.partial.PathElement to be prepended
- returns
a io.scalaland.chimney.partial.Result with io.scalaland.chimney.partial.PathElement prepended to all errors
- Since
0.7.0
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()