Package io.jmix.ui.navigation
Class UrlIdSerializer
java.lang.Object
io.jmix.ui.navigation.UrlIdSerializer
This class is intended for serializing entity ids to be used as URL param.
String, Integer and Long ids are serialized as-is.
UUID ids are serialized using Crockford Base32 encoding.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
deserializeId
(Class idClass, String serializedId) Deserializes the givenserializedId
as an id withidClass
type.static String
serializeId
(Object id) Serializes the givenid
to string representation.
-
Method Details
-
serializeId
Serializes the givenid
to string representation.String, Integer, Long and UUID ids are only supported.
- Parameters:
id
- id to serialize- Returns:
- serialized string representation of id
- Throws:
IllegalArgumentException
- if null id is passed or it has an unsupported type
-
deserializeId
Deserializes the givenserializedId
as an id withidClass
type.String, Integer, Long and UUID ids are only supported.
- Parameters:
idClass
- id typeserializedId
- serialized id- Returns:
- deserialized id
- Throws:
IllegalArgumentException
- if null id and/or type are passed or the given id type is not supported
-