//start
public enum AccountStatus {
individual(0, "enter"),//haghighi
juridical(1, "enter");//hoghughi
private final Integer index;
private final String title;
AccountStatus(Integer index, String title,String persianTitle) {
this.index = index;
this.title = title;
}
public Integer getIndex() { return index; }
public String getTitle() { return title; }
public static AccountStatus valueOfIndex(Integer index) {
for (AccountStatus type : values()) {
if (type.getIndex()==index) {
return type;
}
}
throw new IllegalArgumentException(
"Partnership status cannot be resolved for code " + index);
}
//end
how can map AccountStatus ---->Index;
how can map Index ---->AccountStatus;
how can map AccountStatus--->title;
//start public enum AccountStatus { individual(0, "enter"),//haghighi juridical(1, "enter");//hoghughi
public static AccountStatus valueOfIndex(Integer index) { for (AccountStatus type : values()) { if (type.getIndex()==index) { return type; } } throw new IllegalArgumentException( "Partnership status cannot be resolved for code " + index); } //end
how can map AccountStatus ---->Index; how can map Index ---->AccountStatus; how can map AccountStatus--->title;