public abstract class DateType extends TypeSchema
| Modifier and Type | Field and Description |
|---|---|
static SimpleDateFormat |
DATE_FORMATTER
complete date format which could conform with time long value
note that
if we employ this format, we need to extend time gene for supporting millisecond and timezone
|
IntParam |
day
day field
|
IntParam |
hour
hour field
|
IntParam |
millisecond
millisecond field
|
IntParam |
minute
minute field
|
IntParam |
month
month field
|
IntParam |
second
second field
|
static SimpleDateFormat |
SIMPLE_DATE_FORMATTER
simple date format
current default setting for handling date
|
IntParam |
timezone
time zone field
|
IntParam |
year
year field
|
depth, spec| Constructor and Description |
|---|
DateType(String type,
String fullTypeName,
Class<?> clazz,
JavaDtoSpec spec) |
DateType(String type,
String fullTypeName,
Class<?> clazz,
JavaDtoSpec spec,
List<IntParam> dateFields) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
formatZZZZ(int zone) |
List<IntParam> |
getDateFields() |
abstract Object |
getDateInstance(List<IntParam> values) |
abstract long |
getDateLong(List<IntParam> values) |
abstract String |
getDateString(List<IntParam> values) |
abstract List<IntParam> |
getIntValues(Object date)
extract value of fields based on the date instance
|
protected void |
setDateFields(List<IntParam> fields) |
copy, getClazz, getDto, getFullTypeName, getFullTypeNameWithGenericType, getSimpleTypeName, getTypeNameForInstanceInJavaOrKotlin, sameType, setOriginalTypepublic final IntParam year
public final IntParam month
public final IntParam day
public final IntParam hour
public final IntParam minute
public final IntParam second
public final IntParam millisecond
public final IntParam timezone
public static final SimpleDateFormat SIMPLE_DATE_FORMATTER
public static final SimpleDateFormat DATE_FORMATTER
public DateType(String type, String fullTypeName, Class<?> clazz, JavaDtoSpec spec)
public List<IntParam> getDateFields()
public abstract Object getDateInstance(List<IntParam> values)
values - are a list of values for the datepublic abstract List<IntParam> getIntValues(Object date)
date - is an instance of Date, eg, java.util.Date or java.time.LocalDatepublic abstract long getDateLong(List<IntParam> values)
values - public abstract String getDateString(List<IntParam> values)
values - are a list of values for the dateprotected String formatZZZZ(int zone)
Copyright © 2016–2025. All rights reserved.