All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pers.clare.hisql.naming.LowerCaseNamingStrategy Maven / Gradle / Ivy

The newest version!
package pers.clare.hisql.naming;

@SuppressWarnings("unused")
public class LowerCaseNamingStrategy implements NamingStrategy {

    @Override
    public StringBuilder turnCamelCase(StringBuilder sb, String name) {
        int l = name.length();
        char[] cs = name.toCharArray();
        char c = cs[0];
        sb.append(Character.toLowerCase(c));
        for (int i = 1; i < l; i++) {
            c = cs[i];
            if (Character.isUpperCase(c)) {
                c = Character.toLowerCase(c);
                sb.append('_');
            }
            sb.append(c);
        }
        return sb;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy