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

com.github.paganini2008.devtools.converter.LocaleConverter Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package com.github.paganini2008.devtools.converter;

import java.util.Locale;

import com.github.paganini2008.devtools.LocaleUtils;

/**
 * LocaleConverter
 * 
 * @author Fred Feng
 * @version 1.0
 */
public class LocaleConverter extends BaseConverter {

	private final Converter stringConverter = new Converter() {
		public Locale getValue(String source, Locale defaultValue) {
			if (source == null) {
				return defaultValue;
			}
			return LocaleUtils.getLocale(source);
		}
	};

	public LocaleConverter() {
		put(String.class, stringConverter);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy