/** * get class array instance. * * @param desc desc. * @return Class class array. * @throws ClassNotFoundException */ public static Class<?>[] desc2classArray(String desc) throws ClassNotFoundException { Class<?>[] ret = desc2classArray(ClassHelper.getClassLoader(), desc); return ret; }
/** * name to class. * "boolean" => boolean.class * "java.util.Map[][]" => java.util.Map[][].class * * @param name name. * @return Class instance. */ public static Class<?> name2class(String name) throws ClassNotFoundException { return name2class(ClassHelper.getClassLoader(), name); }
/** * desc to class. * "[Z" => boolean[].class * "[[Ljava/util/Map;" => java.util.Map[][].class * * @param desc desc. * @return Class instance. * @throws ClassNotFoundException */ public static Class<?> desc2class(String desc) throws ClassNotFoundException { return desc2class(ClassHelper.getClassLoader(), desc); }
public void updateIdIfAbsent(String value) { if (StringUtils.isNotEmpty(value) && StringUtils.isEmpty(id)) { this.id = value; } }
/** * @param prefix the prefix of Configuration Properties * @param beanName the binding Bean Name */ public DubboConfigBindingBeanPostProcessor(String prefix, String beanName) { Assert.notNull(prefix, "The prefix of Configuration Properties must not be null"); Assert.notNull(beanName, "The name of bean must not be null"); this.prefix = prefix; this.beanName = beanName; }
/** * <p>Checks if the array is not null or empty. <p/> * * @param array th array to check * @return {@code true} if the array is not null or empty. */ public static boolean isNotEmpty(final Object[] array) { return !isEmpty(array); } }
@Override public Object getInternalProperty(String key) { return ConfigUtils.getProperty(key); } }
public static Object[] generalize(Object[] objs) { Object[] dests = new Object[objs.length]; for (int i = 0; i < objs.length; i++) { dests[i] = generalize(objs[i]); } return dests; }
/** * write. * * @param is InputStream instance. * @param os OutputStream instance. * @return count. * @throws IOException */ public static long write(InputStream is, OutputStream os) throws IOException { return write(is, os, BUFFER_SIZE); }
public static boolean checkNoError() { if (findLevel(Level.ERROR) == 0) { return true; } else { return false; } }
public void setInterface(String interfaceName) { this.interfaceName = interfaceName; if (StringUtils.isEmpty(id)) { id = interfaceName; } }
/** * get class array instance. * * @param desc desc. * @return Class class array. * @throws ClassNotFoundException */ public static Class<?>[] desc2classArray(String desc) throws ClassNotFoundException { Class<?>[] ret = desc2classArray(ClassHelper.getClassLoader(), desc); return ret; }
/** * name to class. * "boolean" => boolean.class * "java.util.Map[][]" => java.util.Map[][].class * * @param name name. * @return Class instance. */ public static Class<?> name2class(String name) throws ClassNotFoundException { return name2class(ClassHelper.getClassLoader(), name); }
/** * desc to class. * "[Z" => boolean[].class * "[[Ljava/util/Map;" => java.util.Map[][].class * * @param desc desc. * @return Class instance. * @throws ClassNotFoundException */ public static Class<?> desc2class(String desc) throws ClassNotFoundException { return desc2class(ClassHelper.getClassLoader(), desc); }
/** * write. * * @param is InputStream instance. * @param os OutputStream instance. * @return count. * @throws IOException */ public static long write(InputStream is, OutputStream os) throws IOException { return write(is, os, BUFFER_SIZE); }
public void setInterface(String interfaceName) { this.interfaceName = interfaceName; if (StringUtils.isEmpty(id)) { id = interfaceName; } }
/** * is not empty string. * * @param str source string. * @return is not empty. */ public static boolean isNotEmpty(String str) { return !isEmpty(str); }