BSONTimestamp
Date: 2015-03-03

org.bson.types

## Class BSONTimestamp

- java.lang.Object
- - org.bson.types.BSONTimestamp

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BSONTimestamp>

      public class BSONTimestamp
      extends java.lang.Object
      implements java.lang.Comparable<BSONTimestamp>, java.io.Serializable

  this is used for internal increment values. for storing normal dates in MongoDB, you should use java.util.Date time is seconds since epoch inc is an ordinal
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BSONTimestamp()`
    `BSONTimestamp(java.util.Date time, int inc)`
    `BSONTimestamp(int time, int inc)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(BSONTimestamp ts)`
    `static BSONTimestamp` | `current()`
    `boolean` | `equals(java.lang.Object obj)`
    `int` | `getInc()`
    `int` | `getTime()`
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BSONTimestamp

          public BSONTimestamp()

    - #### BSONTimestamp

          public BSONTimestamp(int time,
                       int inc)

    - #### BSONTimestamp

          public BSONTimestamp(java.util.Date time,
                       int inc)

  - ### Method Detail

    - #### current

          public static final BSONTimestamp current()

    - #### getTime

          public int getTime()

      Returns:
        get time in seconds since epoch

    - #### getInc

          public int getInc()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### compareTo

          public int compareTo(BSONTimestamp ts)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<BSONTimestamp>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`