程序包 org.anyline.util
类 BasicUtil
java.lang.Object
org.anyline.util.BasicUtil
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static int子串出现次数static boolean检测是否符合el格式 ${body}
主要过滤掉${A}xxx{B}中间不能再再现其他{}或${}格式static String压缩空白 将多个空白压缩成一个空格static String[]static StringcompressXml(String xml) static Stringstatic String拼接字符static booleancontains(boolean ignoreNull, Collection<Object> objs, Object obj) static booleanstatic booleancontainsString(boolean ignoreNull, boolean ignoreCase, Object[] objs, String obj) 数组是否包含static <T> booleancontainsString(boolean ignoreNull, boolean ignoreCase, Collection<T> objs, String obj) static booleancontainsString(Object[] objs, String obj) static booleancontainsString(Collection<Object> objs, String obj) static String截取子串static String超长部分忽略static booleanequals(byte[] bytes1, byte[] bytes2) static booleanstatic boolean对象toString相等static booleanv1与v2是否相等static booleanv1与v2是否相等static booleanequalsIgnoreCase(Object obj1, Object obj2) static Stringstatic <T> Tevl(boolean recursion, T... values) 反回第一个不为空(""|null|empty)的值 没有符合条件的 则返回NULL 与nvl区别 : ""不符合evl条件 但符合nvl条件static <T> Tevl(T... values) static Objectfetch(Collection<?> items, String key, Object value) static StringfillChar(int src, int len) static Stringstatic Stringstatic Stringstatic Stringstatic String填充字符(从左侧填充)static Stringstatic StringgetMapKeys(Map<?, ?> map) 提取HashMap的keystatic StringgetRandomCnString(int length) 随机中文字符(GBK)static StringgetRandomLowerString(int length) static doublegetRandomNumber(double fr, double to) static intgetRandomNumber(int fr, int to) 随机数static StringgetRandomNumberString(int length) static StringgetRandomString(int length) static StringgetRandomString(int length, StringBuffer buffer) 生成随机字符串static StringgetRandomUpperString(int length) static intstatic <T> intindex(boolean ignoreNull, boolean ignoreCase, Collection<T> objs, String obj) static intindex(boolean ignoreNull, Collection<Object> objs, Object obj) static intindex(int index, int size) 计算下标static intstatic intstatic intindex(Collection<Object> objs, String obj) static String在src的第idx位置插入keystatic booleanstatic booleanstatic booleanisDateTime(Object obj) static boolean是否为空或""或"null"(大写字母"NULL"不算空) 集合对象检查是否为空或集合中是否有对象static booleanstatic boolean是否全部为空static booleanisNotEmpty(boolean recursion, Object obj) static booleanisNotEmpty(Object obj) static boolean判断数字static String从左侧开始取len位static List<InetAddress> 获取本机IPlocalIps()获取本机IP地址static <T> Tnvl(T... values) nvl 取第一个不为null的值, 没有符合条件的 则返回nullstatic Stringstatic Stringstatic BooleanparseBoolean(Object obj) static BooleanparseBoolean(Object obj, Boolean def) 类型转换static Bytestatic Bytestatic BigDecimalparseDecimal(Object value, double def) static BigDecimalparseDecimal(Object value, BigDecimal def) static DoubleparseDouble(Object value, Double def) static FloatparseFloat(Object value, Float def) static Integerstatic IntegerparseLimit(int num) 拆分权限数 : 将任意一个数拆分成多个(2的n次方)的和static Longstatic Longstatic ShortparseShort(Object value) static ShortparseShort(Object value, Short def) static int[]确认边界static String字符串替换static String从右侧开始取len位static String删除空格static String删除空格static String
-
字段详细资料
-
SINGLE_CHAR
- 另请参阅:
-
-
构造器详细资料
-
BasicUtil
public BasicUtil()
-
-
方法详细资料
-
isEmpty
是否为空或""或"null"(大写字母"NULL"不算空) 集合对象检查是否为空或集合中是否有对象- 参数:
recursion- recursion 是否递归查检集合对象obj- obj- 返回:
- boolean
-
isEmpty
-
isEmpty
是否全部为空- 参数:
objs- objs- 返回:
- boolean
-
isNotEmpty
-
isNotEmpty
-
equals
public static boolean equals(byte[] bytes1, byte[] bytes2) -
equals
-
equalsIgnoreCase
-
equals
对象toString相等- 参数:
obj1- objectobj2- objectignoreCase- 是否忽略大小写- 返回:
- boolean
-
nvl
public static <T> T nvl(T... values) nvl 取第一个不为null的值, 没有符合条件的 则返回null- 类型参数:
T- T- 参数:
values- values- 返回:
- T
-
evl
public static <T> T evl(boolean recursion, T... values) 反回第一个不为空(""|null|empty)的值 没有符合条件的 则返回NULL 与nvl区别 : ""不符合evl条件 但符合nvl条件- 类型参数:
T- T- 参数:
recursion- recursionvalues- values- 返回:
- Object
-
evl
public static <T> T evl(T... values) -
getRandomNumber
public static int getRandomNumber(int fr, int to) 随机数- 参数:
fr- frto- to- 返回:
- int
-
getRandomNumber
public static double getRandomNumber(double fr, double to) -
getRandomString
生成随机字符串- 参数:
length- lengthbuffer- buffer- 返回:
- String
-
getRandomString
-
getRandomLowerString
-
getRandomUpperString
-
getRandomNumberString
-
getRandomCnString
随机中文字符(GBK)- 参数:
length- length- 返回:
- String
-
insert
在src的第idx位置插入key- 参数:
src- srcidx- idxkey- key- 返回:
- String
-
isNumber
判断数字- 参数:
obj- obj- 返回:
- boolean
-
isBoolean
-
isDate
-
isDateTime
-
parseByte
-
parseByte
-
parseShort
-
parseShort
-
parseInt
-
parseInt
-
parseFloat
-
parseDouble
-
parseDecimal
-
parseDecimal
-
parseLong
-
parseLong
-
parseBoolean
类型转换- 参数:
obj- objdef- def- 返回:
- Boolean
-
parseBoolean
-
parseLimit
拆分权限数 : 将任意一个数拆分成多个(2的n次方)的和- 参数:
num- num- 返回:
- List
-
replace
字符串替换- 参数:
src- srcpattern- patternreplace- replace- 返回:
- String
-
trim
删除空格- 参数:
str- str- 返回:
- String
-
trim
删除空格- 参数:
str- str- 返回:
- String
-
compress
压缩空白 将多个空白压缩成一个空格- 参数:
str- str- 返回:
- String
-
compress
-
compress
-
compressXml
-
fillLChar
填充字符(从左侧填充)- 参数:
src- 原文chr- 填充字符len- 需要达到的长度- 返回:
- String
-
fillRChar
-
fillChar
-
fillChar
-
fillLChar
-
fillRChar
-
fillChar
-
fillChar
-
getMapKeys
提取HashMap的key- 参数:
map- map- 返回:
- List
-
split
-
charCount
子串出现次数- 参数:
src- srcchr- chr- 返回:
- int
-
fetch
-
cut
截取子串- 参数:
src- stringfr- 开始位置to- 结束位置 负数表示倒数, 如-2表示删除最后2位- 返回:
- String
-
left
从左侧开始取len位- 参数:
src- Stringlen- 截取长度- 返回:
- String
-
right
从右侧开始取len位- 参数:
src- Stringlen- 截取长度- 返回:
- String
-
ellipsis
超长部分忽略- 参数:
length- 最长显示长度src- 原文- 返回:
- String
-
localInetAddress
获取本机IP- 返回:
- List
-
localIps
获取本机IP地址- 返回:
- List
-
containsString
public static boolean containsString(boolean ignoreNull, boolean ignoreCase, Object[] objs, String obj) 数组是否包含- 参数:
ignoreNull- 是否忽略null, 如果忽略 则无论是否包含null都返回falseignoreCase- 是否不区分大小写objs- objsobj- obj- 返回:
- boolean
-
index
-
containsString
-
index
-
contains
-
index
-
index
-
contains
-
containsString
public static <T> boolean containsString(boolean ignoreNull, boolean ignoreCase, Collection<T> objs, String obj) -
index
-
containsString
-
index
-
concat
拼接字符- 参数:
list- listsplit- split- 返回:
- String
-
concat
-
omit
-
omit
-
escape
-
unescape
-
equals
public static boolean equals(Object v1, Object v2, List<String> properties1, List<String> properties2) v1与v2是否相等- 参数:
v1- v1v2- v2properties1- 属性列表1properties2- 属性列表2- 返回:
- boolean
-
equals
v1与v2是否相等- 参数:
v1- v1v2- v2properties- 属性(ID:CD, NM:NAME)(ID, NM)- 返回:
- boolean
-
index
public static int index(int index, int size) 计算下标- 参数:
index- 下标 从0开始 -1表示最后一行 -2表示倒数第2行size- 总行数- 返回:
- 最终下标
-
range
确认边界- 参数:
begin- 开始end- 结束qty- 数量total- 总数- 返回:
- [开始, 结束]
-
checkEl
检测是否符合el格式 ${body}
主要过滤掉${A}xxx{B}中间不能再再现其他{}或${}格式- 参数:
str- string- 返回:
- boolean
-