import java.text.SimpleDateFormat;
-public class SimpleDateFormatUtil {
+public final class SimpleDateFormatUtil {
+
+ /**
+ * revision format according to Yang spec.
+ */
+ private static final String REVISION_SIMPLE_DATE = "yyyy-MM-dd";
+
+ private SimpleDateFormatUtil() {
+ throw new UnsupportedOperationException("Utility class should not be instantiated");
+ }
private static final ThreadLocal<SimpleDateFormat> REVISION_FORMAT = new ThreadLocal<SimpleDateFormat>() {
+ @Override
protected SimpleDateFormat initialValue() {
- return new SimpleDateFormat("yyyy-MM-dd");
- };
+ final SimpleDateFormat fmt = new SimpleDateFormat(REVISION_SIMPLE_DATE);
+ fmt.setLenient(false);
+ return fmt;
+ }
- public void set(SimpleDateFormat value) {
+ @Override
+ public void set(final SimpleDateFormat value) {
throw new UnsupportedOperationException();
- };
+ }
};