Optimized version (should generate much less garbage than UUID).
Optimized version (should generate much less garbage than UUID).
should produce same result as UUID.
Safe way to cast an Guid of marker type A to Guid of marker type B.
Safe way to cast an Guid of marker type A to Guid of marker type B.
This should only be used to convert between Guids with equivalent marker types (i.e. Guid[com.foo.User] -> Guid[org.bar.User]).
It should _not_ be used to convert between Guids with unrelated marker types, like User -> Order.
The target marker type
a new Guid
Tries to be a space/cpu efficient and type safe replacement for java's UUID.
This class takes a single (although unused) type parameter. This is to implemnet compile-time checks while still keeping the json integration simple (only need to define (de)serialization in one place)
E.g.