< prev index next >

src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java

Print this page
8204444: java.time cleanup
Reviewed-by: scolebourne, rriggs


 184     /**
 185      * Gets the chronology of this date-time.
 186      * <p>
 187      * The {@code Chronology} represents the calendar system in use.
 188      * The era and other fields in {@link ChronoField} are defined by the chronology.
 189      *
 190      * @return the chronology, not null
 191      */
 192     default Chronology getChronology() {
 193         return toLocalDate().getChronology();
 194     }
 195 
 196     /**
 197      * Gets the local date part of this date-time.
 198      * <p>
 199      * This returns a local date with the same year, month and day
 200      * as this date-time.
 201      *
 202      * @return the date part of this date-time, not null
 203      */
 204     D toLocalDate() ;
 205 
 206     /**
 207      * Gets the local time part of this date-time.
 208      * <p>
 209      * This returns a local time with the same hour, minute, second and
 210      * nanosecond as this date-time.
 211      *
 212      * @return the time part of this date-time, not null
 213      */
 214     LocalTime toLocalTime();
 215 
 216     /**
 217      * Checks if the specified field is supported.
 218      * <p>
 219      * This checks if the specified field can be queried on this date-time.
 220      * If false, then calling the {@link #range(TemporalField) range},
 221      * {@link #get(TemporalField) get} and {@link #with(TemporalField, long)}
 222      * methods will throw an exception.
 223      * <p>
 224      * The set of supported fields is defined by the chronology and normally includes




 184     /**
 185      * Gets the chronology of this date-time.
 186      * <p>
 187      * The {@code Chronology} represents the calendar system in use.
 188      * The era and other fields in {@link ChronoField} are defined by the chronology.
 189      *
 190      * @return the chronology, not null
 191      */
 192     default Chronology getChronology() {
 193         return toLocalDate().getChronology();
 194     }
 195 
 196     /**
 197      * Gets the local date part of this date-time.
 198      * <p>
 199      * This returns a local date with the same year, month and day
 200      * as this date-time.
 201      *
 202      * @return the date part of this date-time, not null
 203      */
 204     D toLocalDate();
 205 
 206     /**
 207      * Gets the local time part of this date-time.
 208      * <p>
 209      * This returns a local time with the same hour, minute, second and
 210      * nanosecond as this date-time.
 211      *
 212      * @return the time part of this date-time, not null
 213      */
 214     LocalTime toLocalTime();
 215 
 216     /**
 217      * Checks if the specified field is supported.
 218      * <p>
 219      * This checks if the specified field can be queried on this date-time.
 220      * If false, then calling the {@link #range(TemporalField) range},
 221      * {@link #get(TemporalField) get} and {@link #with(TemporalField, long)}
 222      * methods will throw an exception.
 223      * <p>
 224      * The set of supported fields is defined by the chronology and normally includes


< prev index next >