public class PeriodValue extends TermporalAmountValue<Period>
PATTERN_BASIC_ISO_DATE, PATTERN_CURRENCY, PATTERN_FULL, PATTERN_INTEGER, PATTERN_ISO_DATE, PATTERN_ISO_DATE_TIME, PATTERN_ISO_INSTANT, PATTERN_ISO_LOCAL_DATE, PATTERN_ISO_LOCAL_DATE_TIME, PATTERN_ISO_LOCAL_TIME, PATTERN_ISO_OFFSET_DATE, PATTERN_ISO_OFFSET_DATE_TIME, PATTERN_ISO_OFFSET_TIME, PATTERN_ISO_ORDINAL_DATE, PATTERN_ISO_TIME, PATTERN_ISO_WEEK_DATE, PATTERN_ISO_ZONED_DATE_TIME, PATTERN_LONG, PATTERN_MEDIUM, PATTERN_PERCENT, PATTERN_RFC_1123_DATE_TIME, PATTERN_SHORT, RESOLVER_LENIENT, RESOLVER_LENIENT_NO_BRACKETS, RESOLVER_SMART, RESOLVER_SMART_NO_BRACKETS, RESOLVER_STRICT, RESOLVER_STRICT_NO_BRACKETS
Constructor and Description |
---|
PeriodValue() |
Modifier and Type | Method and Description |
---|---|
long |
asLong(Period value,
LocaleInfo localeInfo)
Returns a long value if possible.
|
Period |
convert(Object value,
Value.Type oldType,
LocaleInfo localeInfo)
Converts a value from another type.
|
Period |
createDefault()
Creates the default value object for the data type.
|
static Period |
fromEpochMillis(long millis)
Helper method to create a Period of milliseconds since the Epoch
(1970-01-01 00:00:00 GMT+0:00).
|
String |
getDescription()
Gets the description of the type, used for the Designer.
|
Class<Period> |
getValueClass()
Gets the class of the value.
|
Value.Type |
getValueType()
Gets the value type.
|
Period |
parse(String value)
Creates a Value object from a String using a specified pattern and locale.
|
getFormatter, load, parse, save, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asLongCast, isRightAligned, saveCast, toStringCast, toStringForced
public final Value.Type getValueType()
public static Period fromEpochMillis(long millis)
public String getDescription()
public Period createDefault()
public Period parse(String value) throws ParseException, IllegalAccessException, Exception
value
- The value, never null.ParseException
- If the value could not be parsed.IllegalArgumentException
- For pattern errors.Exception
- For other errors.IllegalAccessException
public Period convert(Object value, Value.Type oldType, LocaleInfo localeInfo) throws Exception
value
- The value to convert.oldType
- The old type, null for not defined.localeInfo
- The locale information, null to look-up from current thread or
if not found, for system default.Exception
- For other errors.public long asLong(Period value, LocaleInfo localeInfo)
value
- The Value object.localeInfo
- The locale information, null to look-up from current thread or
if not found, for system default.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.