1 package com.sun.org.apache.bcel.internal.verifier; 2 3 56 57 65 public class VerificationResult{ 66 67 71 public static final int VERIFIED_NOTYET = 0; 72 73 public static final int VERIFIED_OK = 1; 74 75 public static final int VERIFIED_REJECTED = 2; 76 77 81 private static final String VERIFIED_NOTYET_MSG = "Not yet verified."; 82 83 private static final String VERIFIED_OK_MSG = "Passed verification."; 84 85 89 public static final VerificationResult VR_NOTYET = new VerificationResult(VERIFIED_NOTYET, VERIFIED_NOTYET_MSG); 90 91 public static final VerificationResult VR_OK = new VerificationResult(VERIFIED_OK, VERIFIED_OK_MSG); 92 93 94 private int numeric; 95 96 97 private String detailMessage; 98 99 100 private VerificationResult(){} 101 102 103 public VerificationResult(int status, String message){ 104 numeric = status; 105 detailMessage = message; 106 } 107 108 109 public int getStatus(){ 110 return numeric; 111 } 112 113 114 public String getMessage(){ 115 return detailMessage; 116 } 117 118 121 public boolean equals(Object o){ 122 if (! (o instanceof VerificationResult)) return false; 123 VerificationResult other = (VerificationResult) o; 124 return ((other.numeric == this.numeric) && (other.detailMessage.equals(this.detailMessage))); 125 } 126 127 130 public String toString(){ 131 String ret=""; 132 if (numeric == VERIFIED_NOTYET) ret = "VERIFIED_NOTYET"; 133 if (numeric == VERIFIED_OK) ret = "VERIFIED_OK"; 134 if (numeric == VERIFIED_REJECTED) ret = "VERIFIED_REJECTED"; 135 ret+="\n"+detailMessage+"\n"; 136 return ret; 137 } 138 } 139 | Popular Tags |