java.lang
// 构造器 String String(byte[] bytes, Charset charset) String String(byte[] bytes, String charsetName) String String(Char[] values) String String(StringBuilder builder) // API char charAt(int index) int compareTo(String anotherString) String concat(String str) boolean contains(CharSequence s) boolean endsWith(String suffix) boolean startsWith(String first) static String format(String format, Object... args) byte[] getBytes(String charsetName) int indexOf(int ch) int indexOf(String str, int fromIndex) boolean isEmpty() // 判断是否为"", 若为null, 则抛NullPointException int lastIndexOf(String str, fromIndex) int length() boolean matchers(String regex) String replaceAll(String regex, String replacement) String[] split(String regex) String substring(int beginIndex, int endIndex) char[] toCharArray() String toLowerCase() String toUpperCase() String trim() String valueOf(boolean/char[]/int/double/long/object obj)
StringBuilder StringBuider(CharSequence seq) StringBuilder append(CharSequnce seq) StringBuilder append(Object obj) // 拼接obj.toString(); StringBuilder delete(int start, int end) StringBuilder deleteCharAt(int index) int indexOf(String str, int fromIndex) int lastIndexOf(String str, int fromIndex) StringBuilder insert(int offset, String str) int length() StringBuilder reverse() void setCharAt(int index, char ch) StringBuilder replace(int start, int end, String str) String substring(int start, int end) String toString() void trimToSize() // 尝试缩小占用的存储空间;
org.apache.commit.lang
boolean isNull(String str) boolean isNotEmpty(String str) // 不为null且不为"" boolean isEmpty(String str, boolean trimmed) // trimmed判断时是否删除前后空格; boolean isEmpty(String str) boolean hasLength(String str) // 不为null且length>0 boolean isEqual(String str1, String str2) //若str1和str2都为null, 依然返回true; boolean issubString(String string, String substring) String replaceAll(String s, String oldPattern, String NewPattern, boolean ignoreCase, boolean replaceAll) // ignoreCase是否忽略大小写, repalceAll是否全部替换; String delete(String s, String pattern, boolean ignoreCase, boolean deleteAll) boolean isBlank(String str) //判断不为null且消除空格后不为"" String getFilePostfix(String fileName) //获取文件后缀名HashMap
void clear() object clone() // k-v本身不被克隆 boolean containsKey(Object key) boolean containsValue(Object value) Set> entrySet() V get(Object key) V getOrDefault(Object key, V defaultValue) boolean isEmpty() // null报NullPointException Set keySet() V put(K key, V value) V merge(K key, V value, BiFunction super V, ? super V, ? extends V> remappingFunction) void putAll(Map extends K, ? extends V> m) V putIfAbsent(K key, V value) // 若给定的key没有与value或null相关联, 那么将此key与value相关联, 并返回null; V remove(Object key) boolean remove(Object key, Object value) // 当k-v相映射时删除此键值对; V replace(K key, V vaule) boolean replace(K key, V oldValue, V newValue) int size() Collection values()
org.apache.commons.collections4.MapUtils
org.apache.commons commons-collections4 4.2
MapCollection & CollectionsMapUtils.emptyIfNull(Map map) // return map == null ? Collections.emptyMap() : map; boolean MapUtils.isEmpty(Map map) // return map == null || map.isEmpty();
java.util.ArrayList
boolean add(E e) void add(int index, E element) boolean addAll(Collection extends E> c) void clear() Object clone() boolean contains(Object obj) E get(int index) int indexOf(Object obj) boolean isEmpty() E remove(int index) boolean remove(Object o) boolean removeAll(Collection> c) boolean retainAll(Collection> c) E set(int index, E element) int size() void sort(Comparator super E> c) Object toArray() void trimToSize()
java.util.Collections
boolean Collections.addAll(Collection superT> c, T... elements) QueueCollections.asLiOfQueue(Deque deque) void Collections.fill(List super T> list, T obj) // 用指定元素替代列表中所有元素; int Collections.frequency(Collection> c, Object o) // 返回指定集合中与指定对象相等的元素数; ArrayList Collections.list(Enumeration e) // 返回一个数组列表,其中包含由枚举返回的顺序由指定的枚举返回的元素; void Collections.reverse(List> list) Set Collections.singleton(T o) // 返回一个只包含指定对象的不可变set; List Collections.singletonList(T o) Map Collections.singletonMap(K key, V value) void Collections.sort(List list, Comparator super T> c) Collection Collections.synchronizedCollection(Collection c) List Collections.synchronizedList(List list) Map Collections.synchronizedMap(Map m) Set Collections.synchronizedSet(Set s) Collection Collections.unmodifiableCollection(Collection extends T> c) // 返回一个不可修改的集合; List Collections.unmodifiableList(List extends T> list) Map Collections.unmodifiableMap(Map extends K,? extends V> m) Set Collections.unmodifiableSet(Set extends T> s)
java.util.linkedList
void add(int index, E element) void addFirst(E e) void addLast(E e) E element() E get(int index) E getFirst() E getLast() int indexOf(Object o) boolean offer(E e) // 添加到尾部; boolean offerFirst(E e) E peek() // 索引但不删除此列表的首位; E poll() // 索引且删除此列表首位;



