Here you can find the source of getClassForDomain(String domain)
public static Class getClassForDomain(String domain)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { private static final Map<Class, Set<String>> CLASS_TO_DOMAINS = new HashMap<>(); public static Class getClassForDomain(String domain) { for (Map.Entry<Class, Set<String>> entry : CLASS_TO_DOMAINS.entrySet()) { if (entry.getValue().contains(domain)) return entry.getKey(); }//from www . j a va 2 s . com throw new IllegalArgumentException("Unknown domain '" + domain + "'"); } }