- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ScheduledThreadPoolExecutor s =
new ScheduledThreadPoolExecutor(corePoolSize)
ThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
String str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
- Smart code suggestions by Codota
}
/** * 获取TableInfo * * @param clazz 对象类 * @return TableInfo 对象表信息 */ public static TableInfo table(Class<?> clazz) { TableInfo tableInfo = TableInfoHelper.getTableInfo(clazz); Assert.notNull(tableInfo, "Error: Cannot execute table Method, ClassGenricType not found ."); return tableInfo; }
/** * 断言这个 map 不为 empty * <p>为 empty 则抛异常</p> * * @param map 集合 * @param message 消息 */ public static void notEmpty(Map<?, ?> map, String message, Object... params) { isTrue(CollectionUtils.isNotEmpty(map), message, params); }
/** * 断言这个 数组 不为 empty * <p>为 empty 则抛异常</p> * * @param array 数组 * @param message 消息 */ public static void notEmpty(Object[] array, String message, Object... params) { isTrue(ArrayUtils.isNotEmpty(array), message, params); } }
/** * 断言这个 value 不为 empty * <p>为 empty 则抛异常</p> * * @param value 字符串 * @param message 消息 */ public static void notEmpty(String value, String message, Object... params) { isTrue(StringUtils.isNotEmpty(value), message, params); }
/** * 是否开启逻辑删除 */ public boolean isLogicDelete() { return StringUtils.isNotEmpty(logicDeleteValue); }
/** * 断言这个 object 为 null * <p>不为 null 则抛异常</p> * * @param object 对象 * @param message 消息 */ public static void isNull(Object object, String message, Object... params) { isTrue(object == null, message, params); }
/** * 判断object是否为空,集合会校验size */ public static boolean isNull(Object... objs) { for (Object obj : objs) { if (ObjectUtils.isEmpty(obj)) { return true; } } return false; }
/** * 判断Map是否不为空 * * @param map 入参 * @return boolean */ public static boolean isNotEmpty(Map<?, ?> map) { return !isEmpty(map); } }
/** * 断言这个 boolean 为 true * <p>为 false 则抛出异常</p> * * @param expression boolean 值 * @param message 消息 */ public static void isTrue(boolean expression, String message, Object... params) { if (!expression) { throw ExceptionUtils.mpe(message, params); } }
/** * 判断object是否不为空,集合会校验size */ public static boolean isNotNull(Object... obj) { return !ObjectUtils.isNull(obj); }
/** * 判断数组是否不为空 * * @param array 数组 * @return 数组对象内含有任意对象时返回 true * @see ArrayUtils#isEmpty(Object[]) */ public static boolean isNotEmpty(Object[] array) { return !isEmpty(array); }
/** * 时间 ID = Time + ID * <p>例如:可用于商品订单 ID</p> */ public static String getTimeId() { return getMillisecond() + getId(); }
@Override @SuppressWarnings("all") public Children clone() { return SerializationUtils.clone(typedThis); } }
/** * 第一个首字母小写,之后字符大小写的不变 * <p>StringUtils.firstCharToLower( "UserService" ) = userService</p> * <p>StringUtils.firstCharToLower( "UserServiceImpl" ) = userServiceImpl</p> * * @param rawString 需要处理的字符串 * @return ignore */ public static String firstCharToLower(String rawString) { return prefixToLower(rawString, 1); }
/** * 字符串第一个字母大写 * * @param str 被处理的字符串 * @return 首字母大写后的字符串 */ public static String capitalize(final String str) { return concatCapitalize(null, str); }
/** * 有参构造器 * * @param workerId 工作机器 ID * @param datacenterId 序列号 */ public static void initSequence(long workerId, long datacenterId) { WORKER = new Sequence(workerId, datacenterId); }
/** * 断言这个 collection 不为 empty * <p>为 empty 则抛异常</p> * * @param collection 集合 * @param message 消息 */ public static void notEmpty(Collection<?> collection, String message, Object... params) { isTrue(CollectionUtils.isNotEmpty(collection), message, params); }
/** * 断言这个 boolean 为 false * <p>为 true 则抛出异常</p> * * @param expression boolean 值 * @param message 消息 */ public static void isFalse(boolean expression, String message, Object... params) { isTrue(!expression, message, params); }