package com.utic.center.utic.traf.server.dto.dwdb;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor//(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class ParamAnalysisType implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer analysisType; // 가공분석유형(0: 우선순위, 1: 가중치)

    public static final int ANALYSIS_TYPE_PRIORITY = 0; // 우선순위
    public static final int ANALYSIS_TYPE_WEIGHT = 1; // 가중치

    public void setParam(ParamAnalysisType paramAnalysisType) {
        if (paramAnalysisType.getAnalysisType() == ANALYSIS_TYPE_PRIORITY ||
            paramAnalysisType.getAnalysisType() == ANALYSIS_TYPE_WEIGHT) {
            this.analysisType = paramAnalysisType.getAnalysisType();
        } else {
            // 기본값 설정
            this.analysisType = ANALYSIS_TYPE_WEIGHT;
        }
    }
}
