package com.bizzan.bitrade.constant;

public enum WalletType {
    SPOT(0, "币币钱包"),
    SWAP(1, "合约钱包"),
    SECOND(2, "秒合约钱包"),
    GAME(3, "游戏钱包"),
    FOLLOW(4, "跟单钱包"),
    EXCHANGE(5, "现货钱包");

    WalletType(int number, String description) {
        this.code = number;
        this.description = description;
    }
    private int code;
    private String description;
    public int getCode() {
        return code;
    }
    public String getDescription() {
        return description;
    }
    
    public static WalletType valueOfOrdinal(int ordinal){
        switch (ordinal){
            case 0:return SPOT;
            case 1:return SWAP;
            case 2:return SECOND;
            case 3:return GAME;
            case 4:return FOLLOW;
            case 5:return EXCHANGE;
            default:return null;
        }
    }
    
    public static WalletType valueOfStr(String str){
        switch (str){
            case "SPOT":return SPOT;
            case "SWAP":return SWAP;
            case "SECOND":return SECOND;
            case "GAME":return GAME;
            case "FOLLOW":return FOLLOW;
            case "EXCHANGE":return EXCHANGE;
            default:return null;
        }
    }
}
