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

com.codetaco.calendar.TemporalHelper Maven / Gradle / Ivy

The newest version!
package com.codetaco.calendar;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import com.codetaco.calendar.helper.ITemporalHelperImpl;
import com.codetaco.calendar.helper.TemporalHelperUSImpl;

/**
 * 

* TemporalHelper class. *

* * @author Chris DeGreef [email protected] */ public class TemporalHelper { static ITemporalHelperImpl delegate; static ITemporalHelperImpl getDelegate() { if (delegate == null) delegate = new TemporalHelperUSImpl(); return delegate; } static public DateTimeFormatter getOutputDF() { return getDelegate().getOutputDF(); } static public DateTimeFormatter getOutputDTF() { return getDelegate().getOutputDTF(); } static public SimpleDateFormat getOutputSDF() { return getDelegate().getOutputSDF(); } static public DateTimeFormatter getOutputTF() { return getDelegate().getOutputTF(); } /** *

* parseWithPredefinedParsers. *

* * @param valueStr a {@link java.lang.String} object. * @return a {@link java.util.Date} object. */ static public LocalDateTime parseWithPredefinedParsers(final String valueStr) throws ParseException { return getDelegate().parseWithPredefinedParsers(valueStr); } static public ITemporalHelperImpl setDelegate(final ITemporalHelperImpl newImpl) { final ITemporalHelperImpl previousImpl = delegate; delegate = newImpl; return previousImpl; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy