org.slim3.commons.util
Class TimestampUtil

java.lang.Object
  extended by org.slim3.commons.util.TimestampUtil

public final class TimestampUtil
extends Object

A utility class for Timestamp.

Version:
3.0
Author:
higa

Method Summary
static String getPattern(Locale locale)
          Returns the pattern for the locale.
static String toString(Timestamp value, String pattern)
          Converts the Timestamp value to text.
static Timestamp toTimestamp(Object o)
          Converts the object to Timestamp.
static Timestamp toTimestamp(String text, String pattern)
          Converts the text to Timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toTimestamp

public static Timestamp toTimestamp(Object o)
Converts the object to Timestamp.

Parameters:
o - the object
Returns:
the converted value

toTimestamp

public static Timestamp toTimestamp(String text,
                                    String pattern)
                             throws NullPointerException,
                                    ParseRuntimeException
Converts the text to Timestamp.

Parameters:
text - the text
pattern - the pattern for SimpleDateFormat
Returns:
the converted value
Throws:
NullPointerException - if the pattern parameter is null
ParseRuntimeException - if ParseException is encountered

toString

public static String toString(Timestamp value,
                              String pattern)
Converts the Timestamp value to text.

Parameters:
value - the Timestamp value
pattern - the pattern for SimpleDateFormat
Returns:
the converted value

getPattern

public static String getPattern(Locale locale)
Returns the pattern for the locale.

Parameters:
locale - the locale
Returns:
the pattern


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.