All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.craftsman.creator.LocaleCreator Maven / Gradle / Ivy

Go to download

A library that provides the missing Java 8 type mappers for the Dozer Java Bean Mapper.

The newest version!
package io.craftsman.creator;

import java.util.Locale;

public class LocaleCreator implements Creator {

    @Override
    public Locale create(Object source) {
        Locale srcObject = (Locale) source;
        String language = srcObject.getLanguage() != null ? srcObject.getLanguage() : "";
        String country = srcObject.getCountry() != null ? srcObject.getCountry() : "";
        String variant = srcObject.getVariant() != null ? srcObject.getVariant() : "";
        return new Locale(language, country, variant);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy