This commit adds a new attribute, `caseFormat`, to the `ProjectSettingsState` class. It also introduces a static method `fromSelector` in the `NamingConvention` class to transform a string into a NamingConvention enum. The transformation in `ProjectSettingsComponentState` has been updated to use this new method.
23 lines
535 B
Java
23 lines
535 B
Java
package de.marhali.easyi18n.settings;
|
|
|
|
import com.google.common.base.CaseFormat;
|
|
|
|
public enum NamingConvention {
|
|
SNAKE_CASE("Snake"),
|
|
CAMEL_CASE("Camel"),;
|
|
private final String name;
|
|
|
|
private NamingConvention(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return super.name().toLowerCase();
|
|
}
|
|
static public NamingConvention fromSelector(String name) {
|
|
String formated = name.replace(" ","_");
|
|
return valueOf(formated.toUpperCase());
|
|
}
|
|
}
|