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
  • 相关阅读:
    HTML5学习笔记第二节(Email标签(自动验证格式),Number标签,URL标签...)
    Ping检测工具(QQ皮肤实现)
    C#多线程|匿名委托传参数|测试您的网站能承受的压力|附源代码
    PostgreSQL抛错“不良的类型值: long”之解决
    jdbcTemplate.queryForInt()过时替换方法
    Windows Phone 实用开发技巧(27):创建透明Tile
    快乐技术沙龙技术分享之账户助手
    Windows Phone 实用开发技巧(11):让StackPanel中的控件靠右对齐
    Windows Phone 实用开发技巧(19):使用ProgressIndicator做进度显示
    Windows Phone 实用开发技巧(13):自定义Element Binding
  • 原文地址:https://www.cnblogs.com/zeng200103/p/3779934.html
Copyright © 2011-2022 走看看