
package com.tmerclub.cloud.common.leaf.dto;


import java.io.Serial;
import java.io.Serializable;

/**
 * 分布式id请求参数
 *
 * @author YXF
 * @date 2022-08-17 15:25:19
 */
public class SegmentDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    private String key;

    /**
     * 所需的id数量
     */
    private Integer count;

    /**
     * id， null: 不需要用户id
     */
    private Long id;

    /**
     * id长度
     */
    private Integer length;

    public SegmentDTO() {
    }

    public SegmentDTO(String key, Long id, Integer count) {
        this.key = key;
        this.id = id;
        this.count = count;
    }

    public SegmentDTO(String key, Integer count, Integer length) {
        this.key = key;
        this.count = count;
        this.length = length;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    @Override
    public String toString() {
        return "SegmentItemDTO{" +
                "key='" + key + '\'' +
                ", count=" + count +
                ", id=" + id +
                ", length=" + length +
                '}';
    }
}
