package com.tzld.piaoquan.recommend.server.framework.candidiate;


import com.google.gson.Gson;
import lombok.Data;

@Data
public class CandidateInfo {
    private String candidateQueueName;     // 队列名称
    private int position;               // 在召回中的位置
    private Candidate candidate;        // 队列配置的信息

    public CandidateInfo() {
    }

    public CandidateInfo(CandidateInfo other) {
        this.candidateQueueName = other.getCandidateQueueName();
        this.position = other.getPosition();
        this.candidate = other.candidate != null ? new Candidate(other.candidate) : null;
    }

    public CandidateInfo deepcopy() {
        return new CandidateInfo(this);
    }


    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}