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

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

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

@SuppressWarnings("unused")
public class UpperCaseNamingStrategy 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.toUpperCase(c));
        for (int i = 1; i < l; i++) {
            c = cs[i];
            if (Character.isLowerCase(c)) {
                c = Character.toUpperCase(c);
                sb.append('_');
            }
            sb.append(Character.toUpperCase(c));
        }
        return sb;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy