package com.inspect.analysis.domain;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

@Setter
@Getter
public class AnalyseResItem implements Serializable {
    private String objectId;
    private String algFactory;
    private List<AnalyseResPoint> results;

    public AnalyseResItem clone() {
        return JSONObject.parseObject(JSONObject.toJSONString(this), AnalyseResItem.class);
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        AnalyseResItem that = (AnalyseResItem) object;
        return Objects.equals(objectId, that.objectId) && Objects.equals(results, that.results);
    }

    @Override
    public int hashCode() {
        return Objects.hash(objectId, results);
    }

    @Override
    public String toString() {
        return "AnalyseResItem{" +
                "objectId='" + objectId + '\'' +
                ", results=" + results +
                '}';
    }
}
