[JAVA-839] Fix up ObjectId API Created: 02/Jun/13  Updated: 13/May/14  Resolved: 26/Aug/13

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 2.12.0

Type: Task Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: 2to3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by JAVA-1232 Remove deprecated methods from Object... Closed

 Description   

Add methods:

Deprecate:

  • ObjectId(java.util.Date, int, int)
  • ObjectId(String,boolean)
  • ObjectId(int,int,int)
  • toStringMongod()
  • toStringBabble()
  • babbleToMongod()
  • getTimeSecond()
  • getMachine()
  • getInc()
  • getGenMachineId()
  • getCurrentInc()
  • getTime()
  • isNew()
  • notNew()
  • massageToObjectId(Object)
  • _flip(int)
  • _inc()
  • _machine()
  • _time()

Add:

  • toHexString()
  • getCurrentCounter()
  • getTimestamp()
  • getDate()
  • createFromLegacyFormat(int, int, int)


 Comments   
Comment by auto [ 29/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-839: Added createFromLegacyFormat static factory method. Removed the corresponding 3-args constructor, and other dangerous deprecated methods.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/9e454474616fdddc773ed25b23a983c6bdb3e1c7

Comment by auto [ 26/Aug/13 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-839: Added createFromLegacyFormat static factory method.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4ca169cd0e85b2c66945ed2bda63d9408c25de2c

Comment by auto [ 22/Aug/13 ]

Author:

{u'username': u'trnl', u'name': u'Uladzimir Mihura', u'email': u'trnl.me@gmail.com'}

Message: JAVA-839: deprecated methods should fallback to toByteArray()

This is done because of differences in byte order with in ObjectId between 2.x and 3.x versions
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/ef4393649fcd70fa833c0092ffe669dc19341920

Comment by auto [ 15/Aug/13 ]

Author:

{u'username': u'trnl', u'name': u'Uladzimir Mihura', u'email': u'trnl.me@gmail.com'}

Message: JAVA-839: update ObjectId api

Deprecated:

  • ObjectId(java.util.Date, int, int)
  • ObjectId(String,boolean)
  • ObjectId(int,int,int)
  • toStringMongod()
  • toStringBabble()
  • babbleToMongod()
  • getTimeSecond()
  • getMachine()
  • getInc()
  • getGenMachineId()
  • getCurrentInc()
  • getTime()
  • isNew()
  • notNew()
  • massageToObjectId(Object)
  • _flip(int)
  • _inc()
  • _machine()
  • _time()

Added:

Comment by Uladzimir Mihura [ 08/Aug/13 ]

In 3.x we have toHexString(), toStringMongod() and toString() which actually calls toHexString().
In 2.x toString() called toStringMongod().

I believe that in 3.x it's a right behaviour.

Generated at Thu Feb 08 08:53:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.