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
Objectusing serialization.
- SerializationUtils.clone(T object) Deep clone an
- 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)andindexOf(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[])andtoPrimitive(Xxx[])methods. ArrayUtils.toMap(Object[])
- BooleanUtils
BooleanUtils.toBoolean(String)
7. Flotsam
- BitField
- Validate
Apache Commons Lang的更多相关文章
- 让时间处理简单化 【第三方扩展类库org.apache.commons.lang.time】
JAVA的时间日期处理一直是一个比较复杂的问题,大多数程序员都不能很轻松的来处理这些问题.首先Java中关于时间的类,从 JDK 1.1 开始,Date的作用很有限,相应的功能已由Calendar与D ...
- 关于出现 org.apache.commons.lang.exception.NestableRuntimeException的解决方法
最近做服务端和客户端之间的访问,出现了 org.apache.commons.lang.exception.NestableRuntimeException等状况.实在令人头大,翻到了一个很好的帖子说 ...
- org.apache.commons.lang.StringUtils中常用的方法
org.apache.commons.lang.StringUtils中常用的方法,这里主要列举String中没有,且比较有用的方法: 1. 检查字符串是否为空: static boolean isB ...
- java转换json需要导入的jar包,org/apache/commons/lang/exception/NestableRuntimeException
缺少相应jar包都会有异常,根据异常找jar包导入...... 这里我说下lang包,因为这个包我找了好半天: 我用的是: commons-lang3-3.1.jar 出现异常: jav ...
- org.apache.commons.lang.StringUtils类
org.apache.commons.lang.StringUtils类 本文摘自:(http://www.blogjava.net/japper/archive/2012/05/23/378946. ...
- java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntim [问题点数:40分,结帖人wangxiaohua_001]
14:56:10.093 WARN!! Error for /butterfly/plugins/zhonghang/UsefulData/save_usefuldata.bshjava.lang.N ...
- java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils Caused by: java.lang.ClassNotFou ...
- ssh整合启动tomcat报java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtils
今天搭建了一个ssh项目环境,整合后,访问项目首页,登录不进去,控制台报错,后来调试代码后,在获取数据库数据后,返回到action时,又进入了action导致死循环,其实这里是两个问题,控制台报错如下 ...
- 转 java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
转自:http://blog.csdn.net/zb0567/article/details/7893063 java.lang.ClassNotFoundException: org.apache. ...
- org.apache.commons.lang下的工具类
1.org.apache.commons.lang.ArrayUtils 例子 package chongqingyusp; import java.util.Map; import org.apac ...
随机推荐
- SQL2008代理作业出现错误: c001f011维护计划创建失败的解决方法
SQL2008数据库总会出现从 IClassFactory 为 CLSID 为 {17BCA6E8-A95D-497E-B2F9-AF6AA475916F} 的 COM 组件创建实例失败,原因是出现以 ...
- apiCloud又拍云数据库操作经验
1.在数据库表中有个relation字段,表示一对多(对应其他表的多个记录),这个字段比较奇怪,因为实际上这个字段里并未保存实际值.而是保存在对应表的字段中.但是对应表显示出来并没有这个字段.导出数据 ...
- .NET工程师技术进阶
通常,一个人对技术的掌握程度可以分为精通.熟练.熟悉.了解,详细解析如下: 精通:能够掌握此技术的85%技术要点以上,使用此技术时间超过两年,并使用此技术成功实施5个以上的项目.能使用此技术优化性能或 ...
- 去除表单自动填充时,-webkit浏览器默认给文本框加的黄色背景
input:-webkit-autofill { -webkit-box-shadow:inset 0 0 0 100px #2B2B35 inset; -webkit-text-fill-color ...
- Salesforce 执行顺序
在服务器上,Salesforce按以下顺序执行: 1,从数据库加载原始记录或初始化一个用于更新插入(upsert)语句的记录. 2,从请求加载新记录的字段值并覆盖旧的值. 如果请求来自一个标准的UI( ...
- [转]opencv3.0 鱼眼相机标定
[原文转自]:http://blog.csdn.net/qq_15947787/article/details/51441031 前两天发表的时候没注意,代码出了点错误,所以修改了一下,重新发上来. ...
- 采用重写tostring方法使ComboBox显示对象属性
当ComboBox中添加的是对象集合的时候,如果运行就会发现显示是的命令空间.类名,而如果我们想显示对象属性名的时候,我们就可以在对象类中重写object基类中的tostring方法.
- Foundation框架-NSString和NSMutableString
可变与不可变的字符串 --1-- Foundation框架介绍 1.1 框架介绍 --2-- NSString 2.1 NSString介绍及使用 2.2 NSString创建方式 2.3 从文件中 ...
- C# 线程通信 一
C#多线程通信 using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...
- flume+sparkStreaming实例 实时监控文件demo
1,flume所在的节点不和spark同一个集群 v50和 10-15节点 flume在v50里面 flume-agent.conf spark是开的work节点,就是单点计算节点,不涉及到mast ...