1 package com.dawning.gridview.app.resourcemanagement.service.servicemanagement.discoverresourceutil; 2 3 public enum MissionStatus { 4 5 STATUS_ISWAITING("等待扫描",0), 6 STATUS_ISRUNNING("正在扫描",1), 7 STATUS_ISINTERRUPT("扫描中断",2), 8 STATUS_ISOVER("扫描完成",3); 9 10 11 private String statusName; 12 13 private Integer statusNum; 14 15 private MissionStatus(String statusName,Integer statusNum){ 16 17 this.statusName = statusName; 18 this.statusNum = statusNum; 19 } 20 21 public String getStatusName() { 22 return statusName; 23 } 24 25 public void setStatusName(String statusName) { 26 this.statusName = statusName; 27 } 28 29 public Integer getStatusNum() { 30 return statusNum; 31 } 32 33 public void setStatusNum(Integer statusNum) { 34 this.statusNum = statusNum; 35 } 36 37 38 /*public static void main(String[] args) { 39 System.out.println(MissionStatus.STATUS_ISINTERRUPT.getStatusName()); // 扫描中断 40 System.out.println(MissionStatus.STATUS_ISINTERRUPT.getStatusNum()); // 2 41 }*/ 42 43 }
1 /** 2 * 资源同步状态码 3 * @class SyncStatus 4 * @date 2016-3-10 上午10:49:31 5 * 6 */ 7 enum SyncStatus{ 8 Nosync(0),syncing(1),synced(2),update(3),delete(4),failSync(5); 9 10 private int statusNum; 11 12 private SyncStatus(){} 13 14 private SyncStatus(int statusNum){ 15 this.statusNum = statusNum; 16 } 17 18 public int getStatusNum() { 19 return statusNum; 20 } 21 22 }
使用 : Constants.SyncStatus.Nosync.getStatusNum()