zoukankan      html  css  js  c++  java
  • Apache Commons Lang

    http://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/package-summary.html

    1. Commons Lang 是对java.lang的一个扩展

    2. String

    StringEscapeUtils 提供随机的一段字符串,一般用于产生随机密码   StringEscapeUtils.random(int count)

    RandomStringUtils 对Java, Java Script, HTML and XML 提供转义 

    StringUtils 

    • IsEmpty/IsBlank - checks if a String contains text
    • Trim/Strip - removes leading and trailing whitespace
    • Equals - compares two strings null-safe
    • startsWith - check if a String starts with a prefix null-safe
    • endsWith - check if a String ends with a suffix null-safe
    • IndexOf/LastIndexOf/Contains - null-safe index-of checks
    • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut - index-of any of a set of Strings
    • ContainsOnly/ContainsNone/ContainsAny - does String contains only/none/any of these characters
    • Substring/Left/Right/Mid - null-safe substring extractions
    • SubstringBefore/SubstringAfter/SubstringBetween - substring extraction relative to other strings
    • Split/Join - splits a String into an array of substrings and vice versa
    • Remove/Delete - removes part of a String
    • Replace/Overlay - Searches a String and replaces one String with another
    • Chomp/Chop - removes the last part of a String
    • AppendIfMissing - appends a suffix to the end of the String if not present
    • PrependIfMissing - prepends a prefix to the start of the String if not present
    • LeftPad/RightPad/Center/Repeat - pads a String
    • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize - changes the case of a String
    • CountMatches - counts the number of occurrences of one String in another
    • IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable - checks the characters in a String
    • DefaultString - protects against a null input String
    • Reverse/ReverseDelimited - reverses a String
    • Abbreviate - abbreviates a string using ellipsis
    • Difference - compares Strings and reports on their differences
    • LevenshteinDistance - the number of changes needed to change one String into another

    3. Character

    • CharSet 
    • CharRange
    • CharSetUtils
    • CharUtils

    4. JVM interaction - SystemUtils, CharEncoding

    • SystemUtils: Helpers for java.lang.System
    • CharEncoding

    5.Serialization 

    • SerializationUtils 
      •   SerializationUtils.clone(T object)  Deep clone an Object using serialization.
    • SerializationException

    6.Assorted functions -

    • ObjectUtils
    • ClassUtils
    • ArrayUtils
      • ArrayUtils provides singleton empty arrays for all the basic types. These will largely be of use in the Collections API with its toArray methods, but also will be of use with methods which want to return an empty array on error.
      • add(xxx[], xxx) will add a primitive type to an array, resizing the array as you'd expect. Object is also supported.
      • clone(xxx[]) clones a primitive or Object array.
      • contains(xxx[], xxx) searches for a primitive or Object in a primitive or Object array.
      • getLength(Object) returns the length of any array or an IllegalArgumentException if the parameter is not an array. hashCode(Object)equals(Object, Object)toString(Object)
      • indexOf(xxx[], xxx) and indexOf(xxx[], xxx, int) are copies of the classic String methods, but this time for primitive/Object arrays. In addition, a lastIndexOf set of methods exists.
      • isEmpty(xxx[]) lets you know if an array is zero-sized or null.
      • isSameLength(xxx[], xxx[]) returns true if the arrays are the same length.
      • Along side the add methods, there are also remove methods of two types. The first type remove the value at an index, remove(xxx[], int), while the second type remove the first value from the array, remove(xxx[], xxx).
      • Nearing the end now. The reverse(xxx[]) method turns an array around.
      • The subarray(xxx[], int, int) method splices an array out of a larger array.
      • Primitive to primitive wrapper conversion is handled by the toObject(xxx[]) and toPrimitive(Xxx[]) methods.
      • ArrayUtils.toMap(Object[])
    • BooleanUtils  BooleanUtils.toBoolean(String)

    7. Flotsam 

    • BitField
    • Validate
  • 相关阅读:
    黄聪:C#多线程教程(1):BeginInvoke和EndInvoke方法,解决主线程延时Thread.sleep柱塞问题(转)
    黄聪:C#类似Jquery的html解析类HtmlAgilityPack基础类介绍及运用
    黄聪:国内com域名转移到Godaddy详细教程(转)
    黄聪:Navicat for MySQL的1577错误解决
    黄聪:VPS配置Filezilla Server支持FTP的Passive被动模式(FTP连接不上怎么办?有详细教程)
    黄聪:Microsoft office 2013版下载、安装及破解工具下载破解教程(Windows Toolkit)
    黄聪:mysql搬家,直接复制data文件夹(*.MYD,*.MYI,innodb)出错,无法正常显示
    黄聪:WordPress默认编辑器可视化切换不见了,非插件导致消失问题
    黄聪:自定义WordPress顶部管理工具条的技巧(转)
    黄聪:VS2010中“新建项目”却没有“解决方案”节点,如何调出来
  • 原文地址:https://www.cnblogs.com/zeng200103/p/3779934.html
Copyright © 2011-2022 走看看