io.scalaland.chimney.syntax
Members list
Extensions
Extensions
Converts Try to Result, using Throwable from Failure as failed result.
Converts Try to Result, using Throwable from Failure as failed result.
Attributes
- Returns
-
successful result if scala.util.Success, failed result with Throwable if scala.util.Failure
- Since
-
0.7.0
Allows paths like _.adt.matching[Subtype].field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.adt.matching[Subtype].field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Type parameters
- B
-
subtype for which override should be provided
Attributes
- Returns
-
stubs a value of selected subtype
- Since
-
1.0.0
Allows paths like _.either.matchingLeft.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.either.matchingLeft.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs a value extracted from
Left
- Since
-
1.0.0
Allows paths like _.either.matchingRight.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.either.matchingRight.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs a value extracted from
Right
- Since
-
1.0.0
Allows paths like _.optional.matchingSome.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.optional.matchingSome.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs a value extracted from
Some
- Since
-
1.0.0
Allows paths like _.collection.everyItem.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.collection.everyItem.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs an item extracted from the collection
- Since
-
1.0.0
Allows paths like _.map.everyMapKey.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.map.everyMapKey.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs a key extracted from the map
- Since
-
1.0.0
Allows paths like _.map.everyMapValue.field
when selecting the target fields to override in Chimney DSL.
Allows paths like _.map.everyMapValue.field
when selecting the target fields to override in Chimney DSL.
It can only be used within .withField*
methods where the macros reads it and erases it from the final code!
Attributes
- Returns
-
stubs a value extracted from the map
- Since
-
1.0.0
Converts Either to Result, using an error message from Left as failed result.
Converts Either to Result, using an error message from Left as failed result.
Attributes
- Returns
-
successful result if scala.Right, failed result with an error message if scala.Left
- Since
-
0.7.0
Performs in-place patching of wrapped object with provided value.
Performs in-place patching of wrapped object with provided value.
If you want to customize patching behavior, consider using using method.
Type parameters
- Patch
-
type of patch object
Value parameters
- patch
-
patch object value
- patcher
-
implicit instance of io.scalaland.chimney.Patcher type class
Attributes
- Returns
-
patched value
- See also
-
io.scalaland.chimney.auto#deriveAutomaticPatcher for default implicit instance
- Since
-
0.4.0
Converts Option to Result, using EmptyValue error if None.
Converts Option to Result, using EmptyValue error if None.
Attributes
- Returns
-
successful result if scala.Some, failed result with EmptyValue error if None
- Since
-
0.7.0
Converts Option to Result, using provided error message if None.
Converts Option to Result, using provided error message if None.
Value parameters
- ifEmpty
-
lazy error message for scala.None
Attributes
- Returns
-
successful result if scala.Some, failed result with provided error message if scala.None
- Since
-
0.7.0
Performs in-place transformation of captured source value to target type.
Performs in-place transformation of captured source value to target type.
If you want to customize transformer behavior, consider using io.scalaland.chimney.dsl.TransformerOps#into method.
Type parameters
- To
-
target type
Value parameters
- transformer
-
implicit instance of io.scalaland.chimney.Transformer type class
Attributes
- Returns
-
transformed value of target type
To
- See also
-
io.scalaland.chimney.auto#deriveAutomaticTransformer for default implicit instance
- Since
-
0.1.0
Performs in-place partial transformation of captured source value to target type.
Performs in-place partial transformation of captured source value to target type.
If you want to customize transformer behavior, consider using io.scalaland.chimney.dsl.PartialTransformerOps#intoPartial method.
Type parameters
- To
-
result target type of partial transformation
Value parameters
- transformer
-
implicit instance of io.scalaland.chimney.Transformer type class
Attributes
- Returns
-
partial transformation result value of target type
To
- See also
-
io.scalaland.chimney.auto#deriveAutomaticPartialTransformer for default implicit instance
- Since
-
0.7.0
Performs in-place partial transformation of captured source value to target type.
Performs in-place partial transformation of captured source value to target type.
If you want to customize transformer behavior, consider using io.scalaland.chimney.dsl.PartialTransformerOps#intoPartial method.
Type parameters
- To
-
result target type of partial transformation
Value parameters
- failFast
-
should fail as early as the first set of errors appear
- transformer
-
implicit instance of io.scalaland.chimney.Transformer type class
Attributes
- Returns
-
partial transformation result value of target type
To
- See also
-
io.scalaland.chimney.auto#deriveAutomaticPartialTransformer for default implicit instance
- Since
-
0.7.0