com.databasesandlife.util.jooq.LocaleConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-common Show documentation
Show all versions of java-common Show documentation
Utility classes developed at Adrian Smith Software (A.S.S.)
package com.databasesandlife.util.jooq;
import org.apache.commons.lang3.LocaleUtils;
import org.jooq.Converter;
import java.util.Locale;
@SuppressWarnings({ "serial" })
public class LocaleConverter implements Converter {
@Override public Class fromType() { return String.class; }
@Override public Class toType() { return Locale.class; }
@Override
public Locale from(String x) {
if (x == null) return null;
return LocaleUtils.toLocale(x);
}
@Override
public String to(Locale m) {
if (m == null) return null;
return m.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy