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 ConstantsEnum ConstantDescriptionThis unit replacesChronoUnit.MONTHSwith a fixed length of 30 days.This unit replacesChronoUnit.YEARSwith a fixed length of 360 days. -
Method Summary
Modifier and TypeMethodDescription<R extends Temporal>
RaddTo(R temporal, long amount) longbooleanbooleanAlthough the duration of these units is not accurate, e.g.booleanstatic BrickChronoUnitReturns 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, valueOfMethods inherited from interface java.time.temporal.TemporalUnit
isSupportedBy, toString
-
Enum Constant Details
-
YEARS
This unit replacesChronoUnit.YEARSwith a fixed length of 360 days. This is used when parsing a duration and during the formatting of a duration. -
MONTHS
This unit replacesChronoUnit.MONTHSwith 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:
getDurationin 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:
isDurationEstimatedin interfaceTemporalUnit- Returns:
- false
-
isDateBased
public boolean isDateBased()- Specified by:
isDateBasedin interfaceTemporalUnit
-
isTimeBased
public boolean isTimeBased()- Specified by:
isTimeBasedin interfaceTemporalUnit
-
addTo
- Specified by:
addToin interfaceTemporalUnit
-
between
- Specified by:
betweenin interfaceTemporalUnit
-