public class DateAccessor extends Object implements PropertyAccessor<Date>
| Modifier and Type | Field and Description |
|---|---|
private static SimpleDateFormat |
DATE_FORMATTER
The Constant DATE_FORMATTER.
|
private static org.slf4j.Logger |
log
The log.
|
private static List<String> |
patterns
The patterns.
|
| Constructor and Description |
|---|
DateAccessor() |
| Modifier and Type | Method and Description |
|---|---|
Date |
fromBytes(Class targetClass,
byte[] bytes)
From bytes.
|
Date |
fromString(Class targetClass,
String s)
Converts string representation to the data object whose type is T.
|
Date |
getCopy(Object object)
Gets copy of object
|
static Date |
getDateByPattern(String date)
Get Date from given below formats.
|
static String |
getFormattedObect(String date)
Just to verify with supported types of date pattern.
|
Date |
getInstance(Class<?> clazz) |
byte[] |
toBytes(Object date)
To bytes.
|
String |
toString(Object object)
Converts Object to String.
|
private static org.slf4j.Logger log
private static final SimpleDateFormat DATE_FORMATTER
public Date fromBytes(Class targetClass, byte[] bytes)
PropertyAccessorfromBytes in interface PropertyAccessor<Date>bytes - the bpublic byte[] toBytes(Object date)
PropertyAccessortoBytes in interface PropertyAccessor<Date>date - the objectpublic String toString(Object object)
PropertyAccessortoString in interface PropertyAccessor<Date>object - the objectpublic Date fromString(Class targetClass, String s)
PropertyAccessorfromString in interface PropertyAccessor<Date>s - the spublic static Date getDateByPattern(String date)
date - Date patternPropertyAccessException - throws only if invalid format is supplied.public Date getCopy(Object object)
PropertyAccessorgetCopy in interface PropertyAccessor<Date>public static String getFormattedObect(String date)
date - Date patternPropertyAccessException - throws only if invalid format is supplied.public Date getInstance(Class<?> clazz)
getInstance in interface PropertyAccessor<Date>Copyright © 2015. All Rights Reserved.