Commit Graph

170 Commits

Author SHA1 Message Date
Fabio Lima bc4d66bac1 [maven-release-plugin] prepare for next development iteration 2023-09-03 05:30:42 -03:00
Fabio Lima 7240efd33c [maven-release-plugin] prepare release ulid-creator-5.2.2 2023-09-03 05:30:42 -03:00
Fabio Lima 5400b8cc94 Update README.md 2023-09-03 05:29:54 -03:00
Fabio Lima dbf31d3be7 Initialize the monotonic factory with the minimum timestamp
Now the `MonotonicFunction` inner class is initialized with the instant
1970-01-01 00:00:00.000 UTC, which is represented by the value 0L.

Also updated the documentation and the unit tests.
2023-09-02 21:28:15 -03:00
Fabio Lima c7191c6e27
Update README.md 2023-08-30 03:37:05 -03:00
Fabio Lima d7e0bc6024
Update README.md 2023-08-30 03:34:08 -03:00
Fabio Lima 8f98e2ee36
Merge pull request #30 from moznion/fix_typos
Fix typos in Javadoc of Ulid class
2023-08-27 15:32:53 -03:00
moznion 5701df6096
Fix typos in Javadoc of Ulid class
Signed-off-by: moznion <moznion@mail.moznion.net>
2023-08-18 16:21:57 -07:00
Fabio Lima 6bf6ec6559 [maven-release-plugin] prepare for next development iteration 2023-07-27 20:00:26 -03:00
Fabio Lima 97ded350a1 [maven-release-plugin] prepare release ulid-creator-5.2.1 2023-07-27 20:00:26 -03:00
Fabio Lima 8304bcaae7 [chore] regular maintenance 2023-07-27 20:00:03 -03:00
Fabio Lima dfff0557c9 [chore] regular maintenance 2023-07-23 22:32:11 -03:00
Fabio Lima 7e7e3c496c [chore] regular maintenance 2023-07-23 16:07:24 -03:00
Fabio Lima 9f84f74257
Merge pull request #27 from sollecitom/patch-1
Allow UlidFactory.java to accept a LongSupplier as a time source
2023-07-23 14:01:00 -03:00
Michele Sollecito 9d7f8f87e1
Update UlidFactory.java 2023-07-18 10:05:05 +01:00
Michele Sollecito 3ecd6c84a1
Allow UlidFactory.java to accept a LongSupplier as a time source
Using a `java.time.Clock` to get the current time as milliseconds from epoch is inconvenient, as `java.time.Clock` is an abstract class requiring 3 methods to be implemented, which makes interoperability with other JVM languages e.g. Kotlin hard.

By exposing overloaded factory methods that accept a LongSupplier, this problem disappears without breaking backward compatibility.
2023-07-18 09:56:35 +01:00
Fabio Lima a5006743ed [maven-release-plugin] prepare for next development iteration 2023-04-30 05:26:15 -03:00
Fabio Lima ea7a4346cd [maven-release-plugin] prepare release ulid-creator-5.2.0 2023-04-30 05:26:15 -03:00
Fabio Lima d7a8333053 regular maintenance 2023-04-30 05:24:00 -03:00
Fabio Lima 6641297be8 regular maintenance 2023-04-30 03:49:39 -03:00
Fabio Lima af3a7ee0a1 regular maintenance 2023-04-30 03:33:23 -03:00
Fabio Lima 1a7f97438a regular maintenance 2023-04-30 02:34:28 -03:00
Fabio Lima 36855d4b99 regular maintenance 2023-04-26 03:36:14 -03:00
Fabio Lima fc31807789 regular maintenance 2023-04-26 03:13:34 -03:00
Fabio Lima 644ba86e2c Add Hash ULID generator methods. #25 2023-04-25 23:39:22 -03:00
Fabio Lima 41c15148d3 Add a MIN and MAX constants and methods #26 2023-04-25 23:30:07 -03:00
Fabio Lima dc0082bad6 [maven-release-plugin] prepare for next development iteration 2022-10-22 16:32:05 -03:00
Fabio Lima 44bb5496b2 [maven-release-plugin] prepare release ulid-creator-5.1.0 2022-10-22 15:05:16 -03:00
Fabio Lima ebc145f52a Add a fast method to generate identifiers #22 2022-10-22 15:02:37 -03:00
Fabio Lima b5a7d8db95 [maven-release-plugin] prepare for next development iteration 2022-09-17 09:57:23 -03:00
Fabio Lima 02c47fdc10 [maven-release-plugin] prepare release ulid-creator-5.0.2 2022-09-17 09:57:23 -03:00
Fabio Lima fbe1338ce9 Rewrite docs #21 2022-09-17 09:56:07 -03:00
Fabio Lima aad72e2f11 Optimize comparison and hash #20 2022-08-21 07:43:11 -03:00
Fabio Lima a415007838 [maven-release-plugin] prepare for next development iteration 2022-08-21 07:36:59 -03:00
Fabio Lima d0624448a0 [maven-release-plugin] prepare release ulid-creator-5.0.1 2022-08-21 07:36:59 -03:00
Fabio Lima 3f56210b53 Optimize comparison and hash #20 2022-08-21 07:24:10 -03:00
Fabio Lima 58bc4398c0 [maven-release-plugin] prepare for next development iteration 2022-07-09 14:46:23 -03:00
Fabio Lima 3e6629abb2 [maven-release-plugin] prepare release ulid-creator-5.0.0 2022-07-09 14:46:23 -03:00
Fabio Lima f80eb4029c Add support for RandomGenerator in Java 17 #19 2022-07-09 14:43:36 -03:00
Fabio Lima 3b6a135fd3 [maven-release-plugin] prepare for next development iteration 2022-04-21 21:36:02 -03:00
Fabio Lima 0a8959bd5d [maven-release-plugin] prepare release ulid-creator-4.2.1 2022-04-21 21:36:02 -03:00
Fabio Lima 28ece966b4 handle clock drift #18 2022-04-21 21:34:33 -03:00
Fabio Lima c7738222f9 [maven-release-plugin] prepare for next development iteration 2022-04-21 14:54:19 -03:00
Fabio Lima 6f3dc7029b [maven-release-plugin] prepare release ulid-creator-4.2.0 2022-04-21 14:54:19 -03:00
Fabio Lima 745bd55ffc feat: handle clock drift #18
Added drift tolerance of 10 seconds to preserve monotonicity when the
system clock is adjusted by NTP after a small clock drift or when the
system clock jumps back by 1 second due to leap second.

The random component is incremented when the current time:
- is the same as the previous time;
- has moved backwards up to 10 seconds.

The time component is also incremented if the random component is
exceeded, which is quite rare.
2022-04-21 14:53:06 -03:00
Fabio Lima 5abd3f46ff test: handle clock drift #18
move factory tests to the root package.
2022-04-21 14:33:11 -03:00
Fabio Lima 236044af02
Update README.md 2022-03-01 11:16:09 -03:00
Fabio Lima 8a5fc3d093 regular maintenance 2021-12-11 14:04:34 -03:00
Fabio Lima 44bab60674
Update README.md 2021-11-28 23:34:53 -03:00
Fabio Lima bf3b93167b
Update README.md 2021-11-28 23:28:06 -03:00