io.ultreia.java4all.jaxx.JaxxWidgetsTemperatureI18nEnumHelper Maven / Gradle / Ivy
package io.ultreia.java4all.jaxx;
/*-
* #%L
* JAXX :: Widgets Temperature
* %%
* Copyright (C) 2008 - 2020 Code Lutin, Ultreia.io
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.util.Locale;
import javax.annotation.Generated;
import static io.ultreia.java4all.i18n.I18n.l;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
@Generated(value = "Generated by org.nuiton.i18n.plugin.parser.ParseJavaEnumerationsMojo",date = "Thu Oct 08 12:44:00 UTC 2020")
public class JaxxWidgetsTemperatureI18nEnumHelper {
public static > String getLabel(E e) {
return t(getLabelKey(e));
}
public static > String getLabel(Locale locale, E e) {
return l(locale, getLabelKey(e));
}
protected static > String getLabelKey(E e) {
return "enum." + removeAnonymousSuffix(e.getClass().getName()) + "." + e.name();
}
public static > String getDescription(E e) {
return t(getDescriptionKey(e));
}
public static > String getDescription(Locale locale, E e) {
return l(locale, getDescriptionKey(e));
}
protected static > String getDescriptionKey(E e) {
return "enum." + removeAnonymousSuffix(e.getClass().getName()) + "." + e.name() + ".description";
}
protected static String removeAnonymousSuffix(String className) {
return className.contains("$") ? className.substring(0, className.indexOf("$")) : className;
}
}