Class DefaultShortCodeServiceImpl

java.lang.Object
icu.easyj.core.util.shortcode.impls.DefaultShortCodeServiceImpl
All Implemented Interfaces:
IShortCodeService
Direct Known Subclasses:
MinLengthShortCodeServiceImpl

@LoadLevel(name="default", order=200) public class DefaultShortCodeServiceImpl extends Object implements IShortCodeService
long型ID 与 短字符串 互相转换服务 默认实现
Author:
wangliang181230
  • Field Details

    • charTable

      protected final char[] charTable
      字符集
    • firstChar

      protected final String firstChar
  • Constructor Details

    • DefaultShortCodeServiceImpl

      public DefaultShortCodeServiceImpl()
    • DefaultShortCodeServiceImpl

      public DefaultShortCodeServiceImpl(char[] charTable)
  • Method Details

    • toCode

      @NonNull public String toCode(@NonNull Long id)
      Description copied from interface: IShortCodeService
      long型ID 转换为 短字符串
      Specified by:
      toCode in interface IShortCodeService
      Parameters:
      id - ID(必须大于等于0)
      Returns:
      短字符串
    • toId

      public long toId(@NonNull String shortCode)
      Description copied from interface: IShortCodeService
      短字符串 转换为 long长整形ID
      Specified by:
      toId in interface IShortCodeService
      Parameters:
      shortCode - 短字符串
      Returns:
      原ID