Say we have the following classes:
class ParentPayload {
private String generic;
public ParentPayload() {}
}
and
class ChildPayload extends Parent {
private String childSpecific;
public ChildPayload() {
super();
}
}
Then I have a lambda:
public class Lambda implements RequestHandler<ChildPayload, Void> {
public Void handleRequest(final ChildPayload payload) {
//the payload does not include the generic attribute, only childSpecific
}
}
I tried using param constructors, but Lambda only uses the empty constructor. I was expecting that Lambda would cast the request correctly to include the generic parameter as well as childSpecific