Say I have an interface:
public interface IDto {
}
and a class that implements this interface:
public class UserProfileResponseDto implements IDto {
}
In another interface I have:
public interface ISortingController {
public List<IDto> findAll();
}
In my concrete controller I have:
public List<UserProfileResponseDto> findAll();
but its telling me that it must be
public List<IDto> findAll();
Is there a way that would allow public List<UserProfileResponseDto> findAll();
as it feels like it should be allowed since UserProfileResponseDto
implements IDto
. The reason I ask this question is because I feel that it gives more verbosity the the controller class, which would make it easier to maintain and operate with.