Package io.micronaut.context.annotation
Interface Mapper.MergeStrategy
- Enclosing class:
- Mapper
public static interface Mapper.MergeStrategy
An interface for defining merge strategies.
Merge strategies are used when the mapping has two or more arguments.
-
Method Summary
-
Method Details
-
merge
@Nullable @Nullable Object merge(@Nullable @Nullable Object currentValue, @Nullable @Nullable Object value, @NonNull @NonNull Object valueOwner, @NonNull @NonNull String propertyName, @NonNull @NonNull String mappedPropertyName) Merge a single property by returning the value to set the property to. The merge strategy will be called every time a property needs to be set, even for properties of the first argument.The property that is returned from the method will be set. For example, if you do not want to update the property, return the
currentValue
.- Parameters:
currentValue
- The currently specified valuevalue
- The newly supplied valuevalueOwner
- The owner of the new valuepropertyName
- The name of the property to mergemappedPropertyName
- The name of the property from the owner- Returns:
- The new value to set
-