I have a class named FamilyHistoryPersonModel
that extends a class named PersonModel
.
MapValue mapValue = new MapValue("relatives",
new GenericType<FamilyHistoryPersonModel>() {},
new GenericType<List<FamilyHistoryPersonModel>>() {} //error here
);
Constructor:
private MapValue(String pluralUrl, GenericType<? extends PersonModel> singleResultGenericType, GenericType<List<? extends PersonModel>> listResultGenericType) {
this.pluralUrl = pluralUrl;
this.singleResultGenericType = singleResultGenericType;
this.listResultGenericType = listResultGenericType;
}
Error:
cannot find symbol
symbol : constructor MapValue(java.lang.String,<anonymous com.sun.jersey.api.client.GenericType<com.models.FamilyHistoryPersonModel>>,<anonymous com.sun.jersey.api.client.GenericType<java.util.List<com.models.FamilyHistoryPersonModel>>>)
location: class com.rest.v2.resource.CreatePersonModelIntegrationTest.MapValue
Why am I getting this error? How do I fix it? I don't want to change the constructor to accept GenericType<List<FamilyHistoryPersonModel>> listResultGenericType
I am using JDK 1.6