nl.vpro.domain.classification.LocalizedString Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of media-classification Show documentation
Show all versions of media-classification Show documentation
The classes needed for the 'classification' service used in POMS.
This os based on ClassificationScheme xml's as provided by EBU.
It at the moment is only used for genres, but it could in principle accommodate other types of classification based on
a fixed list.
package nl.vpro.domain.classification;
import java.io.Serial;
import java.util.Locale;
/**
* Extension of {@link nl.vpro.i18n.LocalizedString} in the correct XML namespace
*/
public class LocalizedString extends nl.vpro.i18n.LocalizedString {
@Serial
private static final long serialVersionUID = -6545505135867762847L;
public static LocalizedString copy(nl.vpro.i18n.LocalizedString copy) {
return new LocalizedString(
copy.getValue(),
copy.getLocale(),
copy.getCharsetName()
);
}
protected LocalizedString(String value, Locale locale, String charsetName) {
setValue(value);
setLocale(locale);
setCharsetName(charsetName);
}
public static LocalizedString of(String value, Locale locale) {
if (value == null) {
return null;
} else {
return new LocalizedString(value, locale, null);
}
}
public LocalizedString() {
}
}