com.icthh.xm.commons.permission.access.AbstractResourceFactory Maven / Gradle / Ivy
package com.icthh.xm.commons.permission.access;
import com.icthh.xm.commons.permission.access.repository.ResourceRepository;
import java.util.Map;
public abstract class AbstractResourceFactory implements ResourceFactory {
protected abstract Map> getRepositories();
@Override
public T getResource(ID resourceId, String objectType) {
T result = null;
ResourceRepository resourceRepository = (ResourceRepository) getRepositories().get(objectType);
if (resourceRepository != null) {
result = resourceRepository.findResourceById(resourceId);
}
return result;
}
}