You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use the add method on a PagedModel, this method will return a CollectionModel and we "loose" the type PagedModel type. In fact, if we want to retrieve it, we can cast the CollectionModel into a PagedModel.
This can be achieve creating a new abstract class AbstractCollectionModel<S extends AbstractCollectionModel<S, T>, T> which will extends RepresentationModel<S>. After that, CollectionModel<T> will be empty and will extends AbstractCollectionModel<CollectionModel<T>, T> and it will be almost the same for PagedModel