class AdvancedParameterParser {

    public static AdvancedParameter getAdvancedParamByParamTokenNew(String paramToken, boolean completeConfig) {
        String key;
        boolean[] needAppear = new boolean[1];

        AtomIncreaseType atomicIncreateType = null;
        Comparable<?> atomicIncreateValue = null;

        Range[] rangeObjectArray = null;
        Integer cumulativeTimes = null;

        String[] paramTokens = TStringUtil.split(paramToken, PARAM_SEGMENT_SPLITOR);
        switch (paramTokens.length) {
            case 1:
                if (completeConfig) {
                    throw new IllegalArgumentException("规则必须配置完全，格式如下:#id,1_number,1024#");
                }
                key = parseKeyPart(paramTokens[0], needAppear);
                break;
            case 2:
                // 若只有两个，自增类型默认为number，自增值默认为1； 其他同case 3
                key = parseKeyPart(paramTokens[0], needAppear);

                atomicIncreateType = AtomIncreaseType.NUMBER;
                atomicIncreateValue = 1;

                try {
                    rangeObjectArray = parseRangeArray(paramTokens[1]);
                    cumulativeTimes = getCumulativeTimes(rangeObjectArray[0]);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("输入的参数不为Integer类型,参数为:" + paramToken, e);
                } catch (Exception e) {
                    throw new IllegalArgumentException(e);
                }

                break;
            case 3:
                key = parseKeyPart(paramTokens[0], needAppear);
                try {

                    atomicIncreateType = getIncreaseType(paramTokens[1]);
                    atomicIncreateValue = getAtomicIncreaseValue(paramTokens[1], atomicIncreateType);
                    rangeObjectArray = parseRangeArray(paramTokens[2]);
                    // 长度为三必定有范围定义，否则直接抛错
                    // 如果范围有多段("|"分割)，那么以第一段的跨度为标准
                    cumulativeTimes = getCumulativeTimes(rangeObjectArray[0]);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("输入的参数不为Integer类型,参数为:" + paramToken, e);
                } catch (Exception e) {
                    throw new IllegalArgumentException(e);
                }
                break;
            default:
                throw new IllegalArgumentException("错误的参数个数，必须为1个或者3个，3个的时候为允许使用" + "枚举时的数据");
        }

        return new AdvancedParameter(key,
            atomicIncreateValue,
            cumulativeTimes,
            needAppear[0],
            atomicIncreateType,
            rangeObjectArray);
    }

}