A part of article Series: Mapping FieldValueIDs for the payload of the Emarsys API
A HashMap cannot be defined directly in an annotation.
The following example is NOT possible:
public static Map<Object, Object> salutationMap = new HashMap<>() {{
put("1", "MALE");
put("2", "FEMALE");
put("3", "DIVERS");
}};
@MappingTable(map = salutationMap)
private MappingValue<String> salutation;
A HashMap can be used with Enum, Class or nested Annotation: