Search in sources :

Example 1 with Analysis

use of com.dockerx.traffic.providespro.service.Analysis in project Java-9-Spring-Webflux by kkTranslation.

the class Gui method main.

public static void main(String[] args) {
    ServiceLoader<Analysis> analyses = ServiceLoader.load(Analysis.class);
    // analyses.stream().map(ServiceLoader.Provider::get).forEach(analyzer -> System.out.println(analyzer.getName()));
    Set<Analysis> collect = analyses.stream().filter(p -> isAnno(p.type())).map(ServiceLoader.Provider::get).collect(Collectors.toSet());
    Person nao = new Person(0, 0);
    Person miniperson = new Person(10, 0);
    Person minperson = new Person(1001, 0);
    Person minxperson = new Person(1001, 11);
    Person maxperson = new Person(100000, 11);
    Person maxxperson = new Person(100000, 26);
    Person poorperson = new Person(100000, 0);
    collect.forEach(p -> System.out.println(p.analyze(maxxperson)));
}
Also used : ServiceLoader(java.util.ServiceLoader) Analysis(com.dockerx.traffic.providespro.service.Analysis) Person(com.dockerx.traffic.providespro.entity.Person)

Aggregations

Person (com.dockerx.traffic.providespro.entity.Person)1 Analysis (com.dockerx.traffic.providespro.service.Analysis)1 ServiceLoader (java.util.ServiceLoader)1