我的
java android应用程序中有以下枚举:
static enum PaymentType
{
Scheme(0), Topup(1), Normal(2), Free(3), Promotion(4), Discount(5), Partial(6),
Refund(7), NoShow(8), Prepay(9), Customer(10), Return(11), Change(12), PettyCash(13),
StateTax(14), LocalTax(15), Voucher(16), Membership(17), Gratuity(18), Overpayment(19),
PrepayTime(20), HandlingFee(21);
private int value;
private PaymentType(int i) {
value = i;
}
public int getValue() {
return value;
}
}
我使用这个枚举很多来找出其中一个字符串标签的整数值,例如int i = Lookups.PaymentType.Voucher.getValue();.
我怎么能这样做呢?我有一个数据库的整数值,我需要找到对应的字符串.