com.codetaco.calendar.TemporalHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of calendar Show documentation
Show all versions of calendar Show documentation
A better calendar for JAVA
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;
}
}