package com.yeejoin.equipmanage.common.enums;

/**
 * @author keyong
 * @title: TrueOrFalseEnum
 * <pre>
 * @description: TODO
 * </pre>
 * @date 2020/11/4 19:34
 */
public enum TrueOrFalseEnum {
    real(0, "true", "是", "进口", "0"),fake(1, "false", "否", "国产", "1");

    public final int name;

    public final String value;

    public final String flag;

    public final String desc;

    public final String stringValue;

    TrueOrFalseEnum(int name, String value, String flag, String desc, String stringValue) {
        this.name = name;
        this.value = value;
        this.flag = flag;
        this.desc = desc;
        this.stringValue = stringValue;
    }

    public static String reverseObj(String str) {
        if (str.equalsIgnoreCase(TrueOrFalseEnum.real.stringValue)) {
            return TrueOrFalseEnum.fake.stringValue;
        } else if (str.equalsIgnoreCase(TrueOrFalseEnum.fake.stringValue)) {
            return TrueOrFalseEnum.real.stringValue;
        } else {
            return null;
        }
    }
}
