public class Common extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Common.Function<T,R> |
static interface |
Common.Processor |
static interface |
Common.ResourceFilter |
static class |
Common.StringToBoolean |
static class |
Common.StringToFloat |
static class |
Common.StringToInt |
static class |
Common.StringToLong |
static interface |
Common.Supplier<T> |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_DATE_FORMAT |
static String |
DEFAULT_DATETIME_FORMAT |
static String |
DEFAULT_TIME_FORMAT |
static String |
FILE_SEPARATOR |
static String |
PATH_SEPARATOR |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> Set<T> |
arrayToSet(T[] array) |
static <T extends Comparable<T>> |
between(T t,
T bound1,
T bound2) |
static String |
byte2hex(byte[] b) |
static String |
byte2hex(byte[] b,
int offset,
int length) |
static String |
byte2hex(byte[] b,
int offset,
int length,
int col,
String split) |
static String |
byte2hex(byte[] b,
int col,
String split) |
static Calendar |
calendar(int year) |
static Calendar |
calendar(int year,
int month) |
static Calendar |
calendar(int year,
int month,
int date) |
static Calendar |
calendar(int year,
int month,
int date,
int hour) |
static Calendar |
calendar(int year,
int month,
int date,
int hour,
int minute) |
static Calendar |
calendar(int year,
int month,
int date,
int hour,
int minute,
int second) |
static Calendar |
calendar(int year,
int month,
int date,
int hour,
int minute,
int second,
int millisecond) |
static String |
calendarToStr(Calendar calendar) |
static String |
calendarToStr(Calendar calendar,
String format) |
static String |
camelCase(String s) |
static String |
camelCase(String s,
boolean firstCharUpperCase) |
static String |
camelCase(String s,
boolean firstCharUpperCase,
String delimiters) |
static String |
camelCase(String s,
String delimiters) |
static void |
checkNull(Object o,
String msg) |
static String |
concat(List<String> list,
String split) |
static Calendar |
copy(Calendar calendar) |
static <K extends Serializable,V extends Serializable> |
copyMap(Map<K,V> org,
Map<K,V> target) |
static void |
copyStream(InputStream is,
OutputStream os) |
static void |
copyStream(InputStream is,
OutputStream os,
int blockSize,
boolean flushPerBlock,
int bps) |
static Calendar |
dateToCalendar(Date date) |
static String |
dateToStr(Date date) |
static String |
dateToStr(Date date,
String format) |
static <T extends Serializable> |
deepCopy(T object) |
static Object |
deserialize(byte[] buf) |
static <T> Set<T> |
difference(Set<T> org,
Set<T> todiv)
差集 org - todiv
|
static <T> int |
findInArray(T el,
T[] array) |
static void |
forEach(Common.Processor processor,
Common.ResourceFilter filter,
String... paths) |
static File |
getNewFile(String fileName) |
static URL |
getResource(String resource,
ClassLoader... classLoaders) |
static DateFormat |
getSafetyDateFormat(String format) |
static Long |
getSystemStart() |
static String |
getUUIDStr() |
static byte[] |
hex2byte(String hexString) |
static byte[] |
hex2byte(String hexString,
String ignoreChars) |
static <T> boolean |
inArray(T el,
T[] array) |
static <T> int |
indexOf(T[] array,
T t) |
static <T> Set<T> |
intersection(Set<T> set1,
Set<T> set2)
交集
|
static boolean |
isBlank(String s) |
static boolean |
isSameStr(String s1,
String s2) |
static <T> Set<T> |
join(Collection<T>... sets)
并集
|
static Calendar |
longToCalendar(long l) |
static String |
longToDateStr(long l) |
static String |
longToDateStr(long l,
String format) |
static String |
lowerFirstChar(String string) |
static <T extends Comparable<T>> |
max(T c1,
T c2,
T... others) |
static <T extends Comparable<T>> |
min(T c1,
T c2,
T... others) |
static String |
native2AscII(String str) |
static String |
now() |
static String |
now(String format) |
static String |
nullToStr(String str) |
static byte |
random(byte[] range) |
static double |
random(double[] range) |
static double |
random(double min,
double max) |
static float |
random(float[] range) |
static int |
random(int max) |
static int |
random(int[] range) |
static int |
random(int min,
int max) |
static long |
random(long[] range) |
static long |
random(long min,
long max) |
static short |
random(short[] range) |
static <T> T |
random(T[] range) |
static char |
randomChar(String s) |
static char |
randomGB2312Char()
参考:http://tools.jb51.net/table/gb2312
|
static String |
randomStr(int min,
int max,
String range) |
static RuntimeException |
runtimeException(Throwable th) |
static boolean |
sameString(String str1,
String str2) |
static byte[] |
serialize(Object object) |
static String |
sha1(String content) |
static double |
similarity(String s1,
String s2)
两个字符串的相似度
|
static Calendar |
strToCalendar(String str,
String format) |
static Date |
strToDate(String str) |
static Date |
strToDate(String str,
String format) |
static <T> Map<String,T> |
subMap(String prefix,
Map<String,T> map) |
static <T> T |
to(String str,
T value) |
static String[] |
toArray(String str,
String delim,
Common.Supplier<String[]> v) |
static List<String> |
toArray(String str,
String delim,
List<String> v) |
static String[] |
toArray(String str,
String delim,
String[] v) |
static boolean |
toBool(String str,
boolean v) |
static boolean |
toBool(String str,
Common.Supplier<Boolean> v) |
static int |
toInt(String str,
Common.Supplier<Integer> valueSupplier) |
static int |
toInt(String str,
int value) |
static long |
toLong(String str,
Common.Supplier<Long> value) |
static long |
toLong(String str,
long value) |
static String |
trim(String str,
char... trimChars) |
static String |
trim(String str,
String toTrim) |
static Calendar |
truncate(Calendar calendar,
int fromField) |
static String |
upperFirstChar(String string) |
public static final String PATH_SEPARATOR
public static final String FILE_SEPARATOR
public static void forEach(Common.Processor processor, Common.ResourceFilter filter, String... paths)
public static <T> Set<T> arrayToSet(T[] array)
public static String getUUIDStr()
public static <T> boolean inArray(T el,
T[] array)
public static <T> int findInArray(T el,
T[] array)
public static byte[] serialize(Object object) throws IOException
IOExceptionpublic static Object deserialize(byte[] buf) throws IOException, ClassNotFoundException
public static <T extends Serializable> T deepCopy(T object) throws IOException, ClassNotFoundException
public static int random(int max)
public static int random(int min,
int max)
public static long random(long min,
long max)
public static double random(double min,
double max)
public static <K extends Serializable,V extends Serializable> void copyMap(Map<K,V> org, Map<K,V> target)
public static boolean isBlank(String s)
public static void copyStream(InputStream is, OutputStream os) throws IOException
IOExceptionpublic static void copyStream(InputStream is, OutputStream os, int blockSize, boolean flushPerBlock, int bps) throws IOException
IOExceptionpublic static <T extends Comparable<T>> boolean between(T t, T bound1, T bound2)
public static <T extends Comparable<T>> T max(T c1, T c2, T... others)
public static String byte2hex(byte[] b)
public static String byte2hex(byte[] b, int offset, int length)
public static byte[] hex2byte(String hexString)
public static <T> Set<T> intersection(Set<T> set1, Set<T> set2)
set1 - set2 - public static <T> Set<T> difference(Set<T> org, Set<T> todiv)
org - todiv - public static <T> Set<T> join(Collection<T>... sets)
sets - public static File getNewFile(String fileName) throws IOException
IOExceptionpublic static URL getResource(String resource, ClassLoader... classLoaders)
public static <T> int indexOf(T[] array,
T t)
public static <T> T to(String str, T value)
public static int toInt(String str, Common.Supplier<Integer> valueSupplier)
public static int toInt(String str, int value)
public static long toLong(String str, Common.Supplier<Long> value)
public static long toLong(String str, long value)
public static boolean toBool(String str, Common.Supplier<Boolean> v)
public static boolean toBool(String str, boolean v)
public static String[] toArray(String str, String delim, Common.Supplier<String[]> v)
public static char randomGB2312Char()
public static char randomChar(String s)
public static <T> T random(T[] range)
public static byte random(byte[] range)
public static short random(short[] range)
public static int random(int[] range)
public static long random(long[] range)
public static float random(float[] range)
public static double random(double[] range)
public static DateFormat getSafetyDateFormat(String format)
public static Date strToDate(String str, String format) throws ParseException
ParseExceptionpublic static Date strToDate(String str) throws ParseException
ParseExceptionpublic static Calendar strToCalendar(String str, String format) throws ParseException
ParseExceptionpublic static String longToDateStr(long l)
public static Calendar longToCalendar(long l)
public static <T extends Comparable<T>> T min(T c1, T c2, T... others)
public static Calendar calendar(int year)
public static Calendar calendar(int year, int month)
public static Calendar calendar(int year, int month, int date)
public static Calendar calendar(int year, int month, int date, int hour)
public static Calendar calendar(int year, int month, int date, int hour, int minute)
public static Calendar calendar(int year, int month, int date, int hour, int minute, int second)
public static Calendar calendar(int year, int month, int date, int hour, int minute, int second, int millisecond)
public static String now()
public static RuntimeException runtimeException(Throwable th)
public static Long getSystemStart()
Copyright © 2020. All rights reserved.