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 ObjectdeserializeId(Class idClass, String serializedId) Deserializes the givenserializedIdas an id withidClasstype.static StringserializeId(Object id) Serializes the givenidto string representation.
-
Method Details
-
serializeId
Serializes the givenidto 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 givenserializedIdas an id withidClasstype.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
-