@Override public LocalTime copy(Kryo kryo, LocalTime original) { return new LocalTime(original); } }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using <code>ISOChronology</code> in the default time zone. * The resulting object does not use the zone. * * @return the current time, not null * @since 2.0 */ public static LocalTime now() { return new LocalTime(); }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using <code>ISOChronology</code> in the default time zone. * The resulting object does not use the zone. * * @return the current time, not null * @since 2.0 */ public static LocalTime now() { return new LocalTime(); }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using <code>ISOChronology</code> in the specified time zone. * The resulting object does not use the zone. * * @param zone the time zone, not null * @return the current time, not null * @since 2.0 */ public static LocalTime now(DateTimeZone zone) { if (zone == null) { throw new NullPointerException("Zone must not be null"); } return new LocalTime(zone); }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using the specified chronology. * The resulting object does not use the zone. * * @param chronology the chronology, not null * @return the current time, not null * @since 2.0 */ public static LocalTime now(Chronology chronology) { if (chronology == null) { throw new NullPointerException("Chronology must not be null"); } return new LocalTime(chronology); }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using <code>ISOChronology</code> in the specified time zone. * The resulting object does not use the zone. * * @param zone the time zone, not null * @return the current time, not null * @since 2.0 */ public static LocalTime now(DateTimeZone zone) { if (zone == null) { throw new NullPointerException("Zone must not be null"); } return new LocalTime(zone); }
/** * Obtains a {@code LocalTime} set to the current system millisecond time * using the specified chronology. * The resulting object does not use the zone. * * @param chronology the chronology, not null * @return the current time, not null * @since 2.0 */ public static LocalTime now(Chronology chronology) { if (chronology == null) { throw new NullPointerException("Chronology must not be null"); } return new LocalTime(chronology); }
/** * Converts this object to a <code>LocalTime</code> with the * same time and chronology. * * @return a LocalTime with the same time and chronology * @since 1.3 */ public LocalTime toLocalTime() { return new LocalTime(getMillis(), getChronology()); }
/** * Converts this object to a <code>LocalTime</code> with the * same time and chronology. * * @return a LocalTime with the same time and chronology * @since 1.3 */ public LocalTime toLocalTime() { return new LocalTime(getMillis(), getChronology()); }
/** * Converts this object to a LocalTime with the same time and chronology. * * @return a LocalTime with the same time and chronology */ public LocalTime toLocalTime() { return new LocalTime(getLocalMillis(), getChronology()); }
/** * Returns a copy of this time with different local millis. * <p> * The returned object will be a new instance of the same type. * Only the millis will change, the chronology is kept. * The returned object will be either be a new instance or <code>this</code>. * * @param newMillis the new millis, from 1970-01-01T00:00:00 * @return a copy of this time with different millis */ LocalTime withLocalMillis(long newMillis) { return (newMillis == getLocalMillis() ? this : new LocalTime(newMillis, getChronology())); }
/** * Handle broken serialization from other tools. * @return the resolved object, not null */ private Object readResolve() { if (iChronology == null) { return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC()); } if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) { return new LocalTime(iLocalMillis, iChronology.withUTC()); } return this; }
/** * Converts this object to a LocalTime with the same time and chronology. * * @return a LocalTime with the same time and chronology */ public LocalTime toLocalTime() { return new LocalTime(getLocalMillis(), getChronology()); }
/** * Returns a copy of this time with different local millis. * <p> * The returned object will be a new instance of the same type. * Only the millis will change, the chronology is kept. * The returned object will be either be a new instance or <code>this</code>. * * @param newMillis the new millis, from 1970-01-01T00:00:00 * @return a copy of this time with different millis */ LocalTime withLocalMillis(long newMillis) { return (newMillis == getLocalMillis() ? this : new LocalTime(newMillis, getChronology())); }
/** * Handle broken serialization from other tools. * @return the resolved object, not null */ private Object readResolve() { if (iChronology == null) { return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC()); } if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) { return new LocalTime(iLocalMillis, iChronology.withUTC()); } return this; }
/** * Constructs a LocalTime from the specified millis of day using the * specified chronology. * <p> * The millisOfDay value may exceed the number of millis in one day, * but additional days will be ignored. * This method uses the UTC time zone internally. * * @param millisOfDay the number of milliseconds into a day to convert * @param chrono the chronology, null means ISO chronology */ public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) { chrono = DateTimeUtils.getChronology(chrono).withUTC(); return new LocalTime(millisOfDay, chrono); }
/** * Constructs a LocalTime from the specified millis of day using the * specified chronology. * <p> * The millisOfDay value may exceed the number of millis in one day, * but additional days will be ignored. * This method uses the UTC time zone internally. * * @param millisOfDay the number of milliseconds into a day to convert * @param chrono the chronology, null means ISO chronology */ public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) { chrono = DateTimeUtils.getChronology(chrono).withUTC(); return new LocalTime(millisOfDay, chrono); }
@Override public LocalTime read(Kryo kryo, Input input, Class<LocalTime> type) { final int time = input.readInt(true); return new LocalTime(time, ISOChronology.getInstanceUTC().withZone(DateTimeZone.UTC)); }
/** * Converts this object to a LocalTime with the same time and chronology. * * @return a LocalTime with the same time and chronology * @since 1.3 */ public LocalTime toLocalTime() { return new LocalTime(getHourOfDay(), getMinuteOfHour(), getSecondOfMinute(), getMillisOfSecond(), getChronology()); }
/** * Converts this object to a LocalTime with the same time and chronology. * * @return a LocalTime with the same time and chronology * @since 1.3 */ public LocalTime toLocalTime() { return new LocalTime(getHourOfDay(), getMinuteOfHour(), getSecondOfMinute(), getMillisOfSecond(), getChronology()); }