import com.google.common.base.CaseFormat;一个大大的彩蛋:https://mp.youkuaiyun.com/postedit/82686446
/**
* @author Andypan
* @CaseFormatTest.java
* @{describe}
* @date 2017年7月26日 下午4:44:01
*/
public class CaseFormatTest
{
public static void main(String[] args)
{
String a = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "CONSTANT_NAME"); // returns
String b = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "constantName"); // returns
// "constantName"
System.out.println(a);
System.out.println(b);
}
}