Class UrlIdSerializer

java.lang.Object
io.jmix.flowui.screen.navigation.UrlIdSerializer

public final class UrlIdSerializer extends Object
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.

See Also:
  • Method Details

    • serializeId

      public static String serializeId(Object id)
      Serializes the given id 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

      public static Object deserializeId(Class<?> idClass, String serializedId)
      Deserializes the given serializedId as an id with idClass type.

      String, Integer, Long and UUID ids are only supported.

      Parameters:
      idClass - id type
      serializedId - serialized id
      Returns:
      deserialized id
      Throws:
      IllegalArgumentException - if null id and/or type are passed or the given id type is not supported