public interface TemporalAccessor
GDK enhancements for TemporalAccessor.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public long |
getAt(TemporalField field)Supports the getAt operator; equivalent to calling the TemporalAccessor.getLong method. |
|
public List<Long> |
getAt(Iterable<TemporalField> fields)Supports the getAt operator for an iterable; equivalent to collecting the TemporalAccessor.getLong method for each field in the supplied iterable. |
Supports the getAt operator; equivalent to calling the TemporalAccessor.getLong method.
field - a non-null TemporalFieldSupports the getAt operator for an iterable; equivalent to collecting the TemporalAccessor.getLong method for each field in the supplied iterable.
import static java.time.temporal.ChronoField.*
import java.time.LocalTime
def breakfast = LocalTime.of(8, 30, 0)
def (h, m, s) = breakfast[HOUR_OF_DAY, MINUTE_OF_HOUR, SECOND_OF_MINUTE]
assert "$h:$m:$s" == "8:30:0"
fields - an iterable of non-null TemporalField values