package com.jxy.order.enums;

/**
 * @Description 币价查询范围条件
 * @Date 2022/5/20 11:15
 *
 * @Author 杜懿
 */
public enum ReceivingAddress {

    Address_ONE(1,"ADDRESSFIRSTADDRESSFIRSTADDRESSFIRST"),
    Address_TWO(2,"ADDRESSSECONDADDRESSSECONDADDRESSSECOND"),
    Address_THREE(3,"ADDRESSTHIRDADDRESSTHIRDADDRESSTHIRD"),
    Address_FOUR(4,"ADDRESSFOURTHADDRESSFOURTHADDRESSFOURTH"),
    Address_FIVE(5,"ADDRESSFIFTHADDRESSFIFTHADDRESSFIFTH");

    private final int code;
    private final String address;

    ReceivingAddress(int code, String address)
    {
        this.code = code;
        this.address = address;
    }

    public int getCode()
    {
        return code;
    }

    public String getAddress()
    {
        return address;
    }

    public static String getAddressByCode(int code){
        for (ReceivingAddress r : ReceivingAddress.values()) {
            if(r.getCode()==code){
                return r.getAddress();
            }
        }
        return "";
    }


}
