easy-18in/src/main/java/de/marhali/easyi18n/settings/NamingConvention.java
JPilson b7b3563080 feat: Add case format to ProjectSettingsState and fromSelector method to NamingConvention
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.
2024-04-18 20:48:40 +02:00

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());
}
}