BugSeverity.java 462 B

1234567891011121314151617181920212223
  1. package edu.nju.model;
  2. public enum BugSeverity {
  3. 待定(0),较轻(1),一般(2),严重(3),紧急(4);
  4. private int id;
  5. BugSeverity(int i) {
  6. this.id=id;
  7. }
  8. public int getId(){
  9. return this.id;
  10. }
  11. public static BugSeverity getValue(int code){
  12. for(BugSeverity bugSeverity:values()){
  13. if(bugSeverity.getId()==code){
  14. return bugSeverity;
  15. }
  16. }
  17. return null;
  18. }
  19. }