mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Fix documentation typo and code polish (#3787)
This commit is contained in:
parent
4812d2b030
commit
8f96291911
@ -302,7 +302,7 @@ If you don't want explicitly name all properties from nested source bean, you ca
|
||||
The generated code will map every property from `CustomerDto.record` to `Customer` directly, without need to manually name any of them.
|
||||
The same goes for `Customer.account`.
|
||||
|
||||
When there are conflicts, these can be resolved by explicitely defining the mapping. For instance in the example above. `name` occurs in `CustomerDto.record` and in `CustomerDto.account`. The mapping `@Mapping( target = "name", source = "record.name" )` resolves this conflict.
|
||||
When there are conflicts, these can be resolved by explicitly defining the mapping. For instance in the example above. `name` occurs in `CustomerDto.record` and in `CustomerDto.account`. The mapping `@Mapping( target = "name", source = "record.name" )` resolves this conflict.
|
||||
|
||||
|
||||
This "target this" notation can be very useful when mapping hierarchical objects to flat objects and vice versa (`@InheritInverseConfiguration`).
|
||||
|
@ -192,7 +192,7 @@ The option `DEFAULT` should not be used explicitly. It is used to distinguish be
|
||||
|
||||
[TIP]
|
||||
====
|
||||
When working with an `adder` method and JPA entities, Mapstruct assumes that the target collections are initialized with a collection implementation (e.g. an `ArrayList`). You can use factories to create a new target entity with intialized collections instead of Mapstruct creating the target entity by its constructor.
|
||||
When working with an `adder` method and JPA entities, Mapstruct assumes that the target collections are initialized with a collection implementation (e.g. an `ArrayList`). You can use factories to create a new target entity with initialized collections instead of Mapstruct creating the target entity by its constructor.
|
||||
====
|
||||
|
||||
[[implementation-types-for-collection-mappings]]
|
||||
@ -224,4 +224,4 @@ When an iterable or map mapping method declares an interface type as return type
|
||||
|
||||
|`ConcurrentMap`|`ConcurrentHashMap`
|
||||
|`ConcurrentNavigableMap`|`ConcurrentSkipListMap`
|
||||
|===
|
||||
|===
|
@ -32,7 +32,7 @@ public class IntrospectorUtils {
|
||||
* @return The decapitalized version of the string.
|
||||
*/
|
||||
public static String decapitalize(String name) {
|
||||
if ( name == null || name.length() == 0 ) {
|
||||
if ( name == null || name.isEmpty() ) {
|
||||
return name;
|
||||
}
|
||||
if ( name.length() > 1 && Character.isUpperCase( name.charAt( 1 ) ) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user