1 19 package org.openharmonise.rm.resources.lifecycle; 20 21 28 public final class Status { 29 30 31 private static final int NUM_STATUS_APPROVED = 0; 33 private static final int NUM_STATUS_UNAPPROVED = 1; 34 private static final int NUM_STATUS_UNKNOWN = -1; 35 36 private static final String STRING_STATUS_APPROVED = "APPROVED"; 38 private static final String STRING_STATUS_UNAPPROVED = "UNAPPROVED"; 39 private static final String STRING_STATUS_UNKNOWN = "UNKNOWN"; 40 41 static public final Status APPROVED = new Status(NUM_STATUS_APPROVED,STRING_STATUS_APPROVED); 43 static public final Status UNAPPROVED = new Status(NUM_STATUS_UNAPPROVED,STRING_STATUS_UNAPPROVED); 44 static public final Status UNKNOWN = new Status(NUM_STATUS_UNKNOWN,STRING_STATUS_UNKNOWN); 45 46 private int m_nStatus = -1; 48 private String m_sStatus = STRING_STATUS_UNKNOWN; 49 50 protected Status(int nStatus,String sStatus) { 51 m_nStatus = nStatus; 52 m_sStatus = sStatus; 53 } 54 55 63 static public Status getStatus(int nStatus) { 64 Status retStatus = null; 65 66 if(nStatus == NUM_STATUS_APPROVED) { 67 retStatus = APPROVED; 68 } else if(nStatus == NUM_STATUS_UNAPPROVED) { 69 retStatus = UNAPPROVED; 70 } else { 71 retStatus = UNKNOWN; 72 } 73 74 return retStatus; 75 } 76 77 82 public int getIntValue() { 83 return m_nStatus; 84 } 85 86 91 public String getStringValue() { 92 return m_sStatus; 93 } 94 95 96 99 public String toString() { 100 return m_sStatus; 101 } 102 103 } 104 | Popular Tags |