class ExplicitJobPodResourcePoolResolver implements PodResourcePoolResolver {

    @Override
    public List<ResourcePoolAssignment> resolve(Job<?> job) {
        List<String> resourcePoolNames = StringExt.splitByComma(
                job.getJobDescriptor().getAttributes().get(JobAttributes.JOB_PARAMETER_RESOURCE_POOLS)
        );
        if (resourcePoolNames.isEmpty()) {
            return Collections.emptyList();
        }

        String rule = "Job requested placement in resource pools: " + resourcePoolNames;
        return resourcePoolNames.stream().map(name ->
                ResourcePoolAssignment.newBuilder().withResourcePoolName(name).withRule(rule).build()
        ).collect(Collectors.toList());
    }

}