package com.smppw.common.pojo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Objects;

/**
 * value-label对象，用于配置前端选项内容使用
 * @author wangzaijun
 * @date 2023/4/12 19:31
 * @description value-label对象
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class ValueLabelVO {
    /**
     * 对象具体值
     */
    private String value;
    /**
     * 对象显示的文本值
     */
    private String label;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ValueLabelVO that = (ValueLabelVO) o;
        return value.equals(that.value) && Objects.equals(label, that.label);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value, label);
    }

    @Override
    public String toString() {
        return "ValueLabelVO{" +
                "value='" + value + '\'' +
                ", label='" + label + '\'' +
                '}';
    }
}
