![JAR search and dependency download from the Maven repository](/logo.png)
com.github.netty.core.util.NamespaceUtil Maven / Gradle / Ivy
package com.github.netty.core.util;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author wangzihao
*/
public class NamespaceUtil {
private static Namespace defaultNamespace;
private NamespaceUtil() {
}
public static String newIdName(Class obj) {
String name = StringUtil.firstUpperCase(obj.getSimpleName());
return getDefaultNamespace().newIdName(obj, name);
}
public static String newIdName(String preName, Class obj) {
return preName + newIdName(obj);
}
private static Namespace getDefaultNamespace() {
if (defaultNamespace == null) {
synchronized (NamespaceUtil.class) {
if (defaultNamespace == null) {
defaultNamespace = new Namespace();
}
}
}
return defaultNamespace;
}
static class Namespace {
private final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy