package kr.co.jinwoosi.clfd.framework.cd.model;

import kr.co.jinwoosi.clfd.framework.base.model.BaseModel;
import lombok.*;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CdDtl extends BaseModel implements Comparable<CdDtl>{
	private String cdDtlId;
	private String cdId;
	private String cdDtlNm;
	private String cdDtlLabel;
	private String cdDtlDesc;
	private String cdDtlOrd;
	private String useSt;

	public CdDtl(String cdId) {
		this.cdId = cdId;
	}

	@Override
	public int compareTo(CdDtl o) {
		if (this.cdDtlOrd == null || o.cdDtlOrd == null) {
			return 0;
		}

		if (Integer.parseInt(this.cdDtlOrd) > Integer.parseInt(o.cdDtlOrd)) {
			return 1;
		} else {
			return -1;
		}
	}
}
