package com.izouma.nineth.enums;

public enum OperationType {
    SELL("出售"),
    TRANSFER("转让"),
    give("转赠"),
    EXCHANGE("兑换"),
    AIRDROP("空投"),
    SURPRISE_BOX("惊喜盒子"),
    blind_box_open("盲合打开"),
    DRAW("积分抽奖");

    private final String operation;

    OperationType(String operation) {
        this.operation = operation;
    }

    public String getDescription() {
        return operation;
    }

    public static OperationType getValue(String operation) {
        for (OperationType o :values()){
            if (o.operation.equals(operation)){
                return o;
            }
        }
        return null;
    }

    public static OperationType getValue(int ordinal) {
        for (OperationType o :values()){
            if (o.ordinal()==ordinal){
                return o;
            }
        }
        return null;
    }
}
