Are you an LLM? You can read better optimized documentation at /guide/id-converter.md for this page in Markdown format
IdConverter
ID Converter, used to convert
longtype ID toString, and vice versa.
java
@ThreadSafe
public interface IdConverter {
/**
* convert {@link long} type ID to {@link String}
*
* @param id {@link long} type ID
* @return {@link String} type ID
*/
String asString(long id);
/**
* convert {@link String} type ID to {@link long}
*
* @param idString {@link String} type ID
* @return {@link long} type ID
*/
long asLong(String idString);
}IdConverter implementation class diagram

ToStringIdConverter
String converter, used to convert
longto String or String to long type
- Rules
- long to String: String.valueOf
- String to long: Long.parseLong
Radix62IdConverter
Base-62 converter, used to convert
longtype tobase-62 string, orbase-62 stringtolongtype
- Rules:
[0-9][A-Z][a-z]{11}
Radix36IdConverter
Base-36 converter, used to convert
longtype tobase-36 string, orbase-36 stringtolongtype
- Rules:
[0-9][A-Z]{13}
SnowflakeFriendlyIdConverter
Snowflake ID converter, converts strings conforming to snowflake rules to long, or long to snowflake rule strings
PrefixIdConverter
Converts strings with prefixes to long, or long to strings with prefixes
- Rules
- For example: prefix is
no_, converter usesToStringIdConverter, number1after conversion getsno_1, and vice versa.
- For example: prefix is
