jdk/src/share/classes/java/time/chrono/ThaiBuddhistDate.java
changeset 19841 15c8e97d6a14
parent 19030 32f129cb6351
child 20518 dde564773845
equal deleted inserted replaced
19822:4e10a58fa28f 19841:15c8e97d6a14
    62 import static java.time.temporal.ChronoField.YEAR;
    62 import static java.time.temporal.ChronoField.YEAR;
    63 
    63 
    64 import java.io.DataInput;
    64 import java.io.DataInput;
    65 import java.io.DataOutput;
    65 import java.io.DataOutput;
    66 import java.io.IOException;
    66 import java.io.IOException;
       
    67 import java.io.InvalidObjectException;
    67 import java.io.Serializable;
    68 import java.io.Serializable;
    68 import java.time.Clock;
    69 import java.time.Clock;
    69 import java.time.DateTimeException;
    70 import java.time.DateTimeException;
    70 import java.time.LocalDate;
    71 import java.time.LocalDate;
    71 import java.time.LocalTime;
    72 import java.time.LocalTime;
   104     private static final long serialVersionUID = -8722293800195731463L;
   105     private static final long serialVersionUID = -8722293800195731463L;
   105 
   106 
   106     /**
   107     /**
   107      * The underlying date.
   108      * The underlying date.
   108      */
   109      */
   109     private final LocalDate isoDate;
   110     private final transient LocalDate isoDate;
   110 
   111 
   111     //-----------------------------------------------------------------------
   112     //-----------------------------------------------------------------------
   112     /**
   113     /**
   113      * Obtains the current {@code ThaiBuddhistDate} from the system clock in the default time-zone.
   114      * Obtains the current {@code ThaiBuddhistDate} from the system clock in the default time-zone.
   114      * <p>
   115      * <p>
   446     public int hashCode() {
   447     public int hashCode() {
   447         return getChronology().getId().hashCode() ^ isoDate.hashCode();
   448         return getChronology().getId().hashCode() ^ isoDate.hashCode();
   448     }
   449     }
   449 
   450 
   450     //-----------------------------------------------------------------------
   451     //-----------------------------------------------------------------------
       
   452     /**
       
   453      * Defend against malicious streams.
       
   454      * @return never
       
   455      * @throws InvalidObjectException always
       
   456      */
       
   457     private Object readResolve() throws InvalidObjectException {
       
   458         throw new InvalidObjectException("Deserialization via serialization delegate");
       
   459     }
       
   460 
       
   461     /**
       
   462      * Writes the object using a
       
   463      * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
       
   464      * @serialData
       
   465      * <pre>
       
   466      *  out.writeByte(10);                // identifies a ThaiBuddhistDate
       
   467      *  out.writeInt(get(YEAR));
       
   468      *  out.writeByte(get(MONTH_OF_YEAR));
       
   469      *  out.writeByte(get(DAY_OF_MONTH));
       
   470      * </pre>
       
   471      *
       
   472      * @return the instance of {@code Ser}, not null
       
   473      */
   451     private Object writeReplace() {
   474     private Object writeReplace() {
   452         return new Ser(Ser.THAIBUDDHIST_DATE_TYPE, this);
   475         return new Ser(Ser.THAIBUDDHIST_DATE_TYPE, this);
   453     }
   476     }
   454 
   477 
   455     void writeExternal(DataOutput out) throws IOException {
   478     void writeExternal(DataOutput out) throws IOException {