
io.konik.csv.converter.LanguageCodeConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of konik Show documentation
Show all versions of konik Show documentation
Konik the ZUGFeRD processing library
The newest version!
package io.konik.csv.converter;
import org.dozer.DozerConverter;
import com.neovisionaries.i18n.LanguageCode;
/**
* Intermediate converter used to convert {@link String} to {@link LanguageCode}
* while mapping a single value to a collection using custom add..() method.
*/
public class LanguageCodeConverter extends DozerConverter {
public LanguageCodeConverter() {
this(String.class, LanguageCode.class);
}
public LanguageCodeConverter(Class prototypeA, Class prototypeB) {
super(prototypeA, prototypeB);
}
@Override
public LanguageCode convertTo(String source, LanguageCode destination) {
return LanguageCode.getByCode(source, false);
}
@Override
public String convertFrom(LanguageCode source, String destination) {
return source.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy