-
Notifications
You must be signed in to change notification settings - Fork 2
/
ObjectMapper.groovy
34 lines (30 loc) · 1.08 KB
/
ObjectMapper.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.hpe.amce.mapping
import javax.annotation.Nonnull
import javax.annotation.Nullable
/**
* Maps original object to resulting object.
*
* OO - Original object type.
* RO - Resulting object type.
* P - Type of parameters object.
*/
interface ObjectMapper<OO, RO, P> {
/**
* Applies translation to all specified fields.
*
* @param raw Original object to translate.
* It will be available as {@link MappingContext#originalObject}.
* @param translated Resulting object to populate.
* It will be available as {@link MappingContext#resultObject}.
* @param fields Translation map. Keys are field descriptors and
* values specify if field is mandatory (true) or optional (false).
* @param parameters Additional parameters to be passed to translator.
* Those will be available as {@link MappingContext#parameters}.
* @see FieldMapper#mapField
*/
void mapAllFields(
@Nonnull OO raw,
@Nonnull RO translated,
@Nonnull Map<Field<OO, RO, ?, ?, P>, Boolean> fields,
@Nullable P parameters)
}