import com.google.common.base.CaseFormat;
String s1 = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, "recordId"); String s2 = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, "RecordId"); String s3 = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "RECORD_ID"); String s4 = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "RECORD_ID"); System.out.println(s1); System.out.println(s2); System.out.println(s3); System.out.println(s4);