GeezerVison is showing docs.oracle.com — ChronoField (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.time.temporal
Enum ChronoField
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
<R extends Temporal> R |
adjustInto(R temporal,
long newValue) |
Returns a copy of the specified temporal object with the value of this field set.
|
int |
checkValidIntValue(long value) |
Checks that the specified value is valid and fits in an int.
|
long |
checkValidValue(long value) |
Checks that the specified value is valid for this field.
|
TemporalUnit |
getBaseUnit() |
Gets the unit that the field is measured in.
|
String |
getDisplayName(Locale locale) |
Gets the display name for the field in the requested locale.
|
long |
getFrom(TemporalAccessor temporal) |
Gets the value of this field from the specified temporal object.
|
TemporalUnit |
getRangeUnit() |
Gets the range that the field is bound by.
|
boolean |
isDateBased() |
Checks if this field represents a component of a date.
|
boolean |
isSupportedBy(TemporalAccessor temporal) |
Checks if this field is supported by the temporal object.
|
boolean |
isTimeBased() |
Checks if this field represents a component of a time.
|
ValueRange |
range() |
Gets the range of valid values for the field.
|
ValueRange |
rangeRefinedBy(TemporalAccessor temporal) |
Get the range of valid values for this field using the temporal object to
refine the result.
|
String |
toString() |
Returns the name of this enum constant, as contained in the
declaration.
|
static ChronoField |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static ChronoField[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
-
-
Method Detail
-
valueOf
public static ChronoField 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 name
NullPointerException - if the argument is null
-
toString
public String toString()
Description copied from class: Enum
Returns the name of this enum constant, as contained in the
declaration. This method may be overridden, though it typically
isn't necessary or desirable. An enum type should override this
method when a more "programmer-friendly" string form exists.
- Specified by:
toString in interface TemporalField
- Overrides:
toString in class Enum<ChronoField>
- Returns:
- the name of this enum constant
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|