Closed buko closed 2 years ago
The static method you propose can be very useful. However, I have no plans to work on this repository this month.
I agree that UriCodec
should be called UrnCodec
and it's too late to change it. I chose the current name because of its java.net.URI
parameter. I'm not good at picking names as you can see. That's why the package name is called f4b6a3
. :)
I appreciate any help, as long as it passes the unit tests. PRs are welcome.
Implemented UrnCodec
to decode String
instead of java.net.URI
.
Also added a isUuidUri(java.net.URI)
method to UriCodec
.
I think there is no problem with the existence of UriCodec
and UrnCodec
. Both decode different types of objects.
Released v5.0.0.
Minor issue:
UriCodec should provide a static method to determine if a URI is a UUID:
You can sort of do this by attempting to decode the URI and catching InvalidUuidException but there should be a better, more efficient way to implement this functionality.
(BTW, I now realize this class should be named
UrnCodec
notUriCodec
. It's too late to change now without breaking a bunch of people but it turns out that everybody and their grandmother has a scheme for turning UUIDs into URIs instead of using the standard URN mechanism.)