package com.njcn.common.utils;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.ArrayList;
import java.util.List;

/**
 * 类的介绍：用于生成谐波次数的集合
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/5/5 15:11
 */
public class HarmonicTimesUtil {

    /***
     * 自定义需要查询的谐波次数
     * @author xuyang
     * @param start     起始次数
     * @param end       结束次数
     * @param interval  间隔
     * @return List<Object>
     */
    public static List<Object> harmonicTimesList(@Min(value = 1) @Max(value = 100) Integer start, @Min(value = 1) @Max(value = 100) Integer end, @Min(value = 1) Integer interval) {
        List<Object> timesList = new ArrayList<>();
        for (int i = start; i <= end;i = i+interval) {
            timesList.add(i);
        }
        return timesList;
    }

}
