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

mx.emite.sdk.FechaUtilCache Maven / Gradle / Ivy

package mx.emite.sdk;




import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import mx.emite.sdk.FU.FechaFormatos;


public class FechaUtilCache extends ThreadLocal> {
	
	
	
	@Override
	protected Map initialValue() {
		return new HashMap();
	}

	public DateTimeFormatter get(FechaFormatos tipo) {
		Map map = get();
		DateTimeFormatter sdf = map.get(tipo);
		if (sdf == null) {
			sdf = DateTimeFormatter.ofPattern(tipo.getFormato(),new Locale("es","MX"));
			map.put(tipo, sdf);
		}
		return sdf;
	}
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy