Package com.guflimc.brick.i18n.api.time
Enum Class BrickChronoUnit
- All Implemented Interfaces:
Serializable
,Comparable<BrickChronoUnit>
,Constable
,TemporalUnit
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis unit replacesChronoUnit.MONTHS
with a fixed length of 30 days.This unit replacesChronoUnit.YEARS
with a fixed length of 360 days. -
Method Summary
Modifier and TypeMethodDescription<R extends Temporal>
RaddTo
(R temporal, long amount) long
boolean
boolean
Although the duration of these units is not accurate, e.g.boolean
static BrickChronoUnit
Returns the enum constant of this class with the specified name.static BrickChronoUnit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface java.time.temporal.TemporalUnit
isSupportedBy, toString
-
Enum Constant Details
-
YEARS
This unit replacesChronoUnit.YEARS
with a fixed length of 360 days. This is used when parsing a duration and during the formatting of a duration. -
MONTHS
This unit replacesChronoUnit.MONTHS
with a fixed length of 30 days. This is used when parsing a duration and during the formatting of a duration.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getDuration
- Specified by:
getDuration
in interfaceTemporalUnit
-
isDurationEstimated
public boolean isDurationEstimated()Although the duration of these units is not accurate, e.g. due leap years, we do return false here because these units are meant to be used as if their durations were accurate.- Specified by:
isDurationEstimated
in interfaceTemporalUnit
- Returns:
- false
-
isDateBased
public boolean isDateBased()- Specified by:
isDateBased
in interfaceTemporalUnit
-
isTimeBased
public boolean isTimeBased()- Specified by:
isTimeBased
in interfaceTemporalUnit
-
addTo
- Specified by:
addTo
in interfaceTemporalUnit
-
between
- Specified by:
between
in interfaceTemporalUnit
-