class ResourceComparatorGenerator {

    public Comparator<T> generateComparator(String type) throws ResourceClassNotFoundException {
        switch (type) {
            case SW360Constants.TYPE_COMPONENT:
                return (Comparator<T>)defaultComponentComparator();
            case SW360Constants.TYPE_PROJECT:
                return (Comparator<T>)defaultProjectComparator();
            case SW360Constants.TYPE_RELEASE:
                return (Comparator<T>)defaultReleaseComparator();
            default:
                throw new ResourceClassNotFoundException("No default comparator for resource class with name " + type);
        }
    }

}