public class PayloadDto {
private List<PayloadContentDto> payloadContent = new ArrayList<>();
}
public class PayloadContentDto {
protected String payloadType;
}
public class A extends PayloadContentDto {
private String aProperty;
}
public class B extends PayloadContentDto {
private String bProperty;
}
public PayloadDto getDtoFromPListByteArray(byte[] content) {
...
NSObject parse = PropertyListParser.parse(content);
PayloadDto payloadDto = parse.toJavaObject(PayloadDto.class);
...
}
When calling getDtoFromPListByteArray the payloadContent list contains these types:
[
class PayloadContentDto(payloadType="aType"),
class PayloadContentDto(payloadType="bType"),
]
instead of these expected ones:
[
class A(payloadType="aType", aProperty="a's property"),
class B(payloadType="bType", bProperty="b's property"),
]
Is there any way to achive the proper class convertion?
My problem is the following:
When calling getDtoFromPListByteArray the payloadContent list contains these types:
instead of these expected ones:
Is there any way to achive the proper class convertion?
Something like Jackson annotations