Package org.h2.api
Enum Class IntervalQualifier
- All Implemented Interfaces:
Serializable
,Comparable<IntervalQualifier>
,Constable
Interval qualifier.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDAY
DAY TO HOUR
DAY TO MINUTE
DAY TO SECOND
HOUR
HOUR TO MINUTE
HOUR TO SECOND
MINUTE
MINUTE TO SECOND
MONTH
SECOND
YEAR
YEAR TO MONTH
-
Method Summary
Modifier and TypeMethodDescriptiongetTypeName
(int precision, int scale) Returns full type name.getTypeName
(StringBuilder builder, int precision, int scale, boolean qualifierOnly) Appends full type name to the specified string builder.boolean
hasDays()
Returns whether interval with this qualifier has days.boolean
hasHours()
Returns whether interval with this qualifier has hours.boolean
Returns whether interval with this qualifier has minutes.boolean
Returns whether interval with this qualifier has months.boolean
Returns whether interval with this qualifier has multiple fields.boolean
Returns whether interval with this qualifier has seconds.boolean
hasYears()
Returns whether interval with this qualifier has years.boolean
Returns whether interval with this qualifier is a day-time interval.boolean
Returns whether interval with this qualifier is a year-month interval.toString()
static IntervalQualifier
valueOf
(int ordinal) Returns the interval qualifier with the specified ordinal value.static IntervalQualifier
Returns the enum constant of this class with the specified name.static IntervalQualifier[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
YEAR
YEAR
-
MONTH
MONTH
-
DAY
DAY
-
HOUR
HOUR
-
MINUTE
MINUTE
-
SECOND
SECOND
-
YEAR_TO_MONTH
YEAR TO MONTH
-
DAY_TO_HOUR
DAY TO HOUR
-
DAY_TO_MINUTE
DAY TO MINUTE
-
DAY_TO_SECOND
DAY TO SECOND
-
HOUR_TO_MINUTE
HOUR TO MINUTE
-
HOUR_TO_SECOND
HOUR TO SECOND
-
MINUTE_TO_SECOND
MINUTE TO SECOND
-
-
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
-
valueOf
Returns the interval qualifier with the specified ordinal value.- Parameters:
ordinal
- Java ordinal value (0-based)- Returns:
- interval qualifier with the specified ordinal value
-
isYearMonth
public boolean isYearMonth()Returns whether interval with this qualifier is a year-month interval.- Returns:
- whether interval with this qualifier is a year-month interval
-
isDayTime
public boolean isDayTime()Returns whether interval with this qualifier is a day-time interval.- Returns:
- whether interval with this qualifier is a day-time interval
-
hasYears
public boolean hasYears()Returns whether interval with this qualifier has years.- Returns:
- whether interval with this qualifier has years
-
hasMonths
public boolean hasMonths()Returns whether interval with this qualifier has months.- Returns:
- whether interval with this qualifier has months
-
hasDays
public boolean hasDays()Returns whether interval with this qualifier has days.- Returns:
- whether interval with this qualifier has days
-
hasHours
public boolean hasHours()Returns whether interval with this qualifier has hours.- Returns:
- whether interval with this qualifier has hours
-
hasMinutes
public boolean hasMinutes()Returns whether interval with this qualifier has minutes.- Returns:
- whether interval with this qualifier has minutes
-
hasSeconds
public boolean hasSeconds()Returns whether interval with this qualifier has seconds.- Returns:
- whether interval with this qualifier has seconds
-
hasMultipleFields
public boolean hasMultipleFields()Returns whether interval with this qualifier has multiple fields.- Returns:
- whether interval with this qualifier has multiple fields
-
toString
- Overrides:
toString
in classEnum<IntervalQualifier>
-
getTypeName
Returns full type name.- Parameters:
precision
- precision, or-1
scale
- fractional seconds precision, or-1
- Returns:
- full type name
-
getTypeName
public StringBuilder getTypeName(StringBuilder builder, int precision, int scale, boolean qualifierOnly) Appends full type name to the specified string builder.- Parameters:
builder
- string builderprecision
- precision, or-1
scale
- fractional seconds precision, or-1
qualifierOnly
- iftrue
, don't add the INTERVAL prefix- Returns:
- the specified string builder
-