public abstract class ShortCodeUtils extends Object
用途:邀请码、短链接码、...等等
| Modifier and Type | Field and Description |
|---|---|
static IShortCodeService |
DEFAULT
默认的 短字符串服务
|
static IShortCodeService |
MIN_LENGTH
最小长度的 短字符串服务(默认最小长度5)
|
| Constructor and Description |
|---|
ShortCodeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
toCode(Long id)
根据ID生成短字符串
|
static long |
toId(String shortCode)
短字符串转为64位长整形ID
|
public static final IShortCodeService DEFAULT
public static final IShortCodeService MIN_LENGTH
@NonNull public static String toCode(@NonNull Long id)
id - IDIllegalArgumentException - ID小于0public static long toId(@NonNull
String shortCode)
shortCode - 短字符串Copyright © 2021–2022 EasyJ开源社区. All rights reserved.