New to MapStrut; Object to String Error:
[ERROR] /util/LicenseMapper.java:[11,23] Can't map property "java.lang.Object license.customFields[].value" to "java.lang.String license.customFields[].value". Consider to declare/implement a mapping method: "java.lang.String map(java.lang.Object value)".
Code:
@Mapper
public interface LicenseMapper {
List<License> jsonToDao(List<com.integrator.vo.license.License> source);
}
The vo.license contains List of CustomFields having property as
@SerializedName("Value")
@Expose
private Object value;
The Json has input for one field as object as it might come boolean or string or anything so i have mapped it into object. Whereas in dao layer has same field in String. (In custom mapper i just String.valueof but not sure how to achieve it using Mapstrut)
Can anyone tell me what settings are required in LicenseMapper to convert Object to String?
License Structure - Source and destination:
.
.
private String notes;
private Boolean isIncomplete;
private List<CustomField> customFields = null;
private List<Allocation> allocations = null;
Custom Field Structure in Source (removed gson annotations):
.
.
private String name;
private Object dataType;
private Object value;
Custom FIeld Structure in Destination
private String name;
private String datatype;
private String value;