@LoadLevel(name="min-length", order=100) public class MinLengthShortCodeServiceImpl extends DefaultShortCodeServiceImpl
| Modifier and Type | Field and Description |
|---|---|
static char[] |
DEFAULT_CHAR_TABLE
默认的自定义进制(不含分隔字符
DEFAULT_SEPARATOR) |
static int |
DEFAULT_MIN_LENGTH
默认的短字符串最小长度
|
static char |
DEFAULT_SEPARATOR
默认的分隔字符(不能与
DEFAULT_CHAR_TABLE 中的字符重复) |
charTable, firstChar| Constructor and Description |
|---|
MinLengthShortCodeServiceImpl() |
MinLengthShortCodeServiceImpl(char[] charTable,
char separator) |
MinLengthShortCodeServiceImpl(char[] charTable,
char separator,
int minLength) |
MinLengthShortCodeServiceImpl(char[] charTable,
char separator,
int minLength,
boolean needCheckSeparator)
构造函数
|
| Modifier and Type | Method and Description |
|---|---|
String |
toCode(Long id)
long型ID 转换为 短字符串
|
long |
toId(String shortCode)
短字符串 转换为 long长整形ID
|
public static final char[] DEFAULT_CHAR_TABLE
DEFAULT_SEPARATOR)DEFAULT_SEPARATORpublic static final char DEFAULT_SEPARATOR
DEFAULT_CHAR_TABLE 中的字符重复)DEFAULT_CHAR_TABLE,
Constant Field Valuespublic static final int DEFAULT_MIN_LENGTH
public MinLengthShortCodeServiceImpl(char[] charTable,
char separator,
int minLength,
boolean needCheckSeparator)
charTable - 字符集separator - 分隔字符minLength - 最小长度needCheckSeparator - 是否校验分隔符的有效性public MinLengthShortCodeServiceImpl(char[] charTable,
char separator,
int minLength)
public MinLengthShortCodeServiceImpl(char[] charTable,
char separator)
public MinLengthShortCodeServiceImpl()
@NonNull public String toCode(@NonNull Long id)
IShortCodeServicetoCode in interface IShortCodeServicetoCode in class DefaultShortCodeServiceImplid - ID(必须大于等于0)public long toId(@NonNull
String shortCode)
IShortCodeServicetoId in interface IShortCodeServicetoId in class DefaultShortCodeServiceImplshortCode - 短字符串Copyright © 2021–2022 EasyJ开源社区. All rights reserved.