Class UnmodifiableTimestamp

java.lang.Object
java.util.Date
java.sql.Timestamp
com.aoapps.sql.UnmodifiableTimestamp
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public final class UnmodifiableTimestamp extends Timestamp implements Cloneable
An unmodifiable Timestamp that may be used in return values and shared between threads.
Author:
AO Industries, Inc.
See Also:
  • Constructor Details

    • UnmodifiableTimestamp

      public UnmodifiableTimestamp(long time, int nanos)
    • UnmodifiableTimestamp

      public UnmodifiableTimestamp(long time)
    • UnmodifiableTimestamp

      @Deprecated public UnmodifiableTimestamp(int year, int month, int date, int hour, int minute, int second, int nano)
      Deprecated.
      instead use the constructor Timestamp(long millis)
  • Method Details

    • valueOf

      public static UnmodifiableTimestamp valueOf(Timestamp other)
      Creates a new UnmodifiableTimestamp from a Timestamp.
      1. If the wrapped timestamp is null, returns null.
      2. If the wrapped timestamp is already unmodifiable, returns it.
      3. Otherwise returns a new timestamp with the same value.
    • clone

      public UnmodifiableTimestamp clone()
      Return a copy of this object.
      Overrides:
      clone in class Date
    • setYear

      @Deprecated public void setYear(int year)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setYear in class Date
    • setMonth

      @Deprecated public void setMonth(int month)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setMonth in class Date
    • setDate

      @Deprecated public void setDate(int month)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setDate in class Date
    • setHours

      @Deprecated public void setHours(int month)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setHours in class Date
    • setMinutes

      @Deprecated public void setMinutes(int month)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setMinutes in class Date
    • setSeconds

      @Deprecated public void setSeconds(int month)
      Deprecated.
      As of JDK version 1.1,
      Overrides:
      setSeconds in class Date
    • setTime

      public void setTime(long time)
      Overrides:
      setTime in class Timestamp
    • setNanos

      public void setNanos(int n)
      Overrides:
      setNanos in class Timestamp