Enum Class Leniency
- All Implemented Interfaces:
Serializable
,Comparable<Leniency>
,java.lang.constant.Constable
Defines how lenient parsing of chronological texts should be.
- Author:
- Meno Hochschild
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe parsed data will be interpreted without any consistency check or validation of range limits.This default mode tries to be a compromise between a pedantic and a lax strategy by paying attention to value range constraints but neglecting some constraints like the width of numerical elements.Ensures that all range limits and other validity constraints will be strictly controlled. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isLax()
Is this leniency mode lax?boolean
isSmart()
Is this leniency mode smart?boolean
isStrict()
Is this leniency mode strict?static Leniency
Returns the enum constant of this class with the specified name.static Leniency[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
STRICT
Ensures that all range limits and other validity constraints will be strictly controlled.
Exceeding the possibly context-dependent range of an element value will always throw an exception.
A consistency check will be performed, too. That means all parsed informations must be consistent (for example the right weekday for a given calendar date). In parsing, the given limits for minimum and maximum count of chars to be interpreted will be checked, too.
-
SMART
This default mode tries to be a compromise between a pedantic and a lax strategy by paying attention to value range constraints but neglecting some constraints like the width of numerical elements.
There is no consistency check like in strict mode. For example a wrong weekday will be ignored and the calendar date will just be interpreted on the base of year, month and day of month.
-
LAX
The parsed data will be interpreted without any consistency check or validation of range limits.
This mode even tolerates values like the wall time "T25:00" or the invalid calendar date "2014-02-31" which will be interpreted with the suitable day overflow as "2014-03-03".
-
-
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
-
isStrict
public boolean isStrict()Is this leniency mode strict?
- Returns:
- boolean
-
isSmart
public boolean isSmart()Is this leniency mode smart?
- Returns:
- boolean
-
isLax
public boolean isLax()Is this leniency mode lax?
- Returns:
- boolean
-