Package org.gbif.api.util
Enum IsoDateParsingUtils.IsoDateFormat
- java.lang.Object
-
- java.lang.Enum<IsoDateParsingUtils.IsoDateFormat>
-
- org.gbif.api.util.IsoDateParsingUtils.IsoDateFormat
-
- All Implemented Interfaces:
Serializable
,Comparable<IsoDateParsingUtils.IsoDateFormat>
- Enclosing class:
- IsoDateParsingUtils
public static enum IsoDateParsingUtils.IsoDateFormat extends Enum<IsoDateParsingUtils.IsoDateFormat>
Enumerations with the allowed date formats by the occurrence search service.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description YEAR
YEAR_MONTH
YEAR_MONTH_DAY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDate
earliestDate(String value)
Returns the earliest date of a possible closed range, e.g.boolean
isValidDate(String value)
Checks if the parameter "value" can be parsed using the date format.LocalDate
latestDate(String value)
Returns the latest date of a possible open range, e.g.TemporalAccessor
parseDate(String value)
Try to parse a string with the current date format.static IsoDateParsingUtils.IsoDateFormat
valueOf(String name)
Returns the enum constant of this type with the specified name.static IsoDateParsingUtils.IsoDateFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YEAR_MONTH_DAY
public static final IsoDateParsingUtils.IsoDateFormat YEAR_MONTH_DAY
-
YEAR_MONTH
public static final IsoDateParsingUtils.IsoDateFormat YEAR_MONTH
-
YEAR
public static final IsoDateParsingUtils.IsoDateFormat YEAR
-
-
Method Detail
-
values
public static IsoDateParsingUtils.IsoDateFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IsoDateParsingUtils.IsoDateFormat c : IsoDateParsingUtils.IsoDateFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IsoDateParsingUtils.IsoDateFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isValidDate
public boolean isValidDate(String value)
Checks if the parameter "value" can be parsed using the date format.
-
parseDate
public TemporalAccessor parseDate(String value) throws ParseException
Try to parse a string with the current date format.- Throws:
ParseException
-
earliestDate
public LocalDate earliestDate(String value) throws ParseException
Returns the earliest date of a possible closed range, e.g. 2000-01-01 for 2000.- Throws:
ParseException
-
latestDate
public LocalDate latestDate(String value) throws ParseException
Returns the latest date of a possible open range, e.g. 2001-01-01 for 2000.- Throws:
ParseException
-
-