将Runnable实现为接口的抽象类

时间:2016-03-01 00:11:03

标签: java multithreading refactoring sonarqube future

如何将实现Runnable的抽象类重构为接口?


sudo yum install postgresql93-devel

更新:以及如何在将来删除通用通配符类型的使用?

import com.codahale.metrics.health.HealthCheck;

public abstract class ApplicationProcessor implements Runnable {

    public abstract HealthCheck getHealthCheck();
}

由于

1 个答案:

答案 0 :(得分:1)

public interface ApplicationProcessor extends Runnable {
    // interface methods are by default public and abstract
    HealthCheck getHealthCheck();
}

第2部分使用

Future<Void> or just Future