#1323 - HalModelBuilder.build() now picks up call side generics.

This commit is contained in:
Oliver Drotbohm
2020-07-23 09:27:09 +02:00
parent b560e5228a
commit e05d904fe1

View File

@@ -297,8 +297,8 @@ public class HalModelBuilder {
*
* @return will never be {@literal null}.
*/
public RepresentationModel<?> build() {
return new HalRepresentationModel<>(model, CollectionModel.of(embeddeds), links);
public <T extends RepresentationModel<T>> RepresentationModel<T> build() {
return (T) new HalRepresentationModel<>(model, CollectionModel.of(embeddeds), links);
}
/**