K - code typepublic interface IDescriptiveEnum<K>
descriptive enum type consists of code and description
sample usage:
public enum SexEnum implements IDescriptiveEnum<Character> {
MALE('M', "male"), FEMALE('F', "FEMALE");
Character code;
String description;
SexEnum(char code, String description) {
this.code = code;
this.description = description;
}
public void setCode(Character code) {
this.code = code;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public Character getCode() {
return code;
}
@Override
public String getDescription() {
return description;
}
}
| Modifier and Type | Method and Description |
|---|---|
K |
getCode()
getter for code property
|
String |
getDescription()
getter of description property
|
Copyright © 2018 com.github.avatar21. All rights reserved.