Search in sources :

Example 1 with StackGresVersion

use of io.stackgres.operator.common.StackGresVersion in project stackgres by ongres.

the class ResourceDiscoverer method init.

public void init(Instance<T> instance) {
    resourceHub = Arrays.stream(StackGresVersion.values()).collect(Collectors.toMap(Function.identity(), v -> new ArrayList<>()));
    instance.select(new OperatorVersionBinderLiteral()).stream().forEach(f -> {
        OperatorVersionBinder operatorVersionTarget = f.getClass().getAnnotation(OperatorVersionBinder.class);
        for (int ordinal = operatorVersionTarget.startAt().ordinal(); ordinal <= operatorVersionTarget.stopAt().ordinal(); ordinal++) {
            StackGresVersion version = StackGresVersion.values()[ordinal];
            resourceHub.get(version).add(f);
        }
    });
}
Also used : StackGresVersion(io.stackgres.operator.common.StackGresVersion)

Aggregations

StackGresVersion (io.stackgres.operator.common.StackGresVersion)1