public class Common extends Object
限定符和类型 | 字段和说明 |
---|---|
static String |
FILE_SEPARATOR |
static String |
LINE_SEPARATOR |
static String |
PATH_SEPARATOR |
构造器和说明 |
---|
Common() |
限定符和类型 | 方法和说明 |
---|---|
static <T> Set<T> |
arrayToSet(T[] array) |
static String |
byte2hex(byte[] b) |
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 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 <T extends Serializable> |
deepCopy(T object) |
static <T> Set<T> |
difference(Set<T> org,
Set<T> todiv)
差集 org - todiv
|
static <T> int |
findInArray(T el,
T[] array) |
static File |
getFile(String fileName)
已过时。
|
static File |
getNewFile(String fileName) |
static URL |
getResource(String resource,
ClassLoader... classLoaders) |
static String |
getUUIDStr() |
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 String |
lowerFirstChar(String string) |
static void |
main(String[] args) |
static String |
native2AscII(String str) |
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 boolean |
sameString(String str1,
String str2) |
static String |
sha1(String content) |
static double |
similarity(String s1,
String s2)
两个字符串的相似度
|
static <T> Map<String,T> |
subMap(String prefix,
Map<String,T> map) |
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 int |
toInt(String str,
int value) |
static long |
toLong(String str,
long value) |
static String |
trim(String str,
char... trimChars) |
static String |
trim(String str,
String toTrim) |
static String |
upperFirstChar(String string) |
public static final String LINE_SEPARATOR
public static final String PATH_SEPARATOR
public static final String FILE_SEPARATOR
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 <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
IOException
public static void copyStream(InputStream is, OutputStream os, int blockSize, boolean flushPerBlock, int bps) throws IOException
IOException
public static String byte2hex(byte[] b)
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
- @Deprecated public static File getFile(String fileName) throws IOException
IOException
public static File getNewFile(String fileName) throws IOException
IOException
public static URL getResource(String resource, ClassLoader... classLoaders)
public static <T> int indexOf(T[] array, T t)
public static int toInt(String str, int value)
public static long toLong(String str, long value)
public static boolean toBool(String str, boolean 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 void main(String[] args)
Copyright © 2018. All rights reserved.