Hardcoded¶
class Hardcoded(ids: Iterator<ObjectId>) : ObjectIdGenerator
Hardcoded ObjectId generator with a deterministic input sequence.
Mostly useful as a fake when testing algorithms that must generate IDs.
Constructors¶
Hardcoded¶
Each call to newId will return the next ID in order of ids.
If newId is called once more than the number of IDs in ids, a NoSuchElementException will be thrown.
constructor(vararg ids: ObjectId)
Each call to newId will return the next ID in order of ids.
If newId is called once more than the number of IDs in ids, a NoSuchElementException will be thrown.
Functions¶
newId¶
Creates a new instance of an ObjectId.
Throws
NoSuchElementException-
If the generator is not able to generate more IDs.