标签:central mem turn another script ttl other val int
package cn.com.cfets.imt.client;
public enum AnotherEnum {
/**
* enum 中的values()返回枚举数组 ; valueof():将普通意义上的字符串转换为枚举实例 orlinal()获取枚举成员的索引位置
*/
MEMBERBASICINFO("CG","竞价会员基础信息"),
CNYMARKETCLOSE("hY","结售汇市场闭市信息"),
G7MARKETCLOSE("hN","外币对市场闭市信息 "),
CNYBIDDINGDEAL("8Y","结售汇竞价成交明细"),
G7BIDDINGDEAL("8N","外币对竞价成交明细"),
CNYCENTRALPARITY("WD","中间价"),
CNYSETTLEMENT("BQY","结售汇市场结算清单"),
G7SETTLEMENT("BQN","外币对市场结算清单"),
VALUEDATE("WT", "起息日数据");
private String value;
private String discription;
private AnotherEnum(String value, String discription) {
this.value = value;
this.discription = discription;
}
public String getValue() {
return value;
}
public String getDiscription() {
return discription;
}
public static AnotherEnum getEnum(String value){
AnotherEnum anotherEnum = null;
AnotherEnum e[] = AnotherEnum.values();
for (int i = 0; i < e.length; i++) {
if(e[i].value.equals(value)){
anotherEnum = e[i];
break;
}
}
return anotherEnum;
}
public static void main(String[] args) {
System.out.println(AnotherEnum.getEnum("BQY").getDiscription()+";discription:"+AnotherEnum.getEnum("BQY").getValue());
}
// 二
public enum Opration{
OPRATION_SERVER_CHECK,
OPRATION_SERVER_DB,
OPRATION_SERVER_SEREVICES,
OPRATION_SERVER_PUSHTO_STREAM;
}
}
枚举使用
标签:central mem turn another script ttl other val int
原文地址:https://www.cnblogs.com/lhl-shubiao/p/10348552.html