public final class UrlIdSerializer
extends java.lang.Object
String, Integer and Long ids are serialized as-is.
UUID ids are serialized using Crockford Base32 encoding.
CrockfordUuidEncoder
,
WebUrlRouting
,
UrlChangeHandler
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
deserializeId(java.lang.Class idClass,
java.lang.String serializedId)
Deserializes the given
serializedId as an id with idClass type. |
static java.lang.String |
serializeId(java.lang.Object id)
Serializes the given
id to string representation. |
@Nonnull public static java.lang.String serializeId(java.lang.Object id)
id
to string representation.
String, Integer, Long and UUID ids are only supported.
id
- id to serializejava.lang.IllegalArgumentException
- if null id is passed or it has an unsupported type@Nonnull public static java.lang.Object deserializeId(java.lang.Class idClass, java.lang.String serializedId)
serializedId
as an id with idClass
type.
String, Integer, Long and UUID ids are only supported.
idClass
- id typeserializedId
- serialized idjava.lang.IllegalArgumentException
- if null id and/or type are passed or the given id type is not supported