public class Entity {
}
public class Room extends Entity {
}
public interface IUpdateService<T extends Entity> {
void update(T entity);
void update(Long id, T entity);
}
public interface IRoomUpdateService extends IUpdateService<Room> {
void update(Room entity);
void update(Long id, Room entity);
}
ExecutableHelper.overrides(IRoomUpdateService.class.getMethod("update", Room.class), IUpdateService.class.getMethod("update", Entity.class)) is true, but ExecutableHelper.overrides(IRoomUpdateService.class.getMethod("update", Long.class, Room.class), IUpdateService.class.getMethod("update", Long.class, Entity.class)) is false. |