1 7 package hero.interfaces; 8 9 import java.util.Collection ; 10 11 21 public class InvalidValueException 22 extends Exception 23 { 24 25 29 33 private Object [] mParameters = new Object [ 0 ]; 34 35 39 46 public InvalidValueException( String pMessageHandler, Object pParameters ) 47 { 48 super( pMessageHandler ); 49 if( pParameters != null ) 50 { 51 if( pParameters instanceof Collection ) 52 { 53 mParameters = ( (Collection ) pParameters ).toArray( new Object [ 0 ] ); 54 } 55 else 56 { 57 if( pParameters instanceof Object [] ) 58 { 59 mParameters = (Object []) pParameters; 60 } 61 else 62 { 63 mParameters = new Object [] { pParameters }; 64 } 65 } 66 } 67 } 68 69 73 78 public Object [] getParameters() 79 { 80 return mParameters; 81 } 82 83 88 public String toString() 89 { 90 return super.toString(); 91 } 92 93 100 public boolean equals( Object pTest ) 101 { 102 return super.equals( pTest ); 103 } 104 105 110 public int hashCode() 111 { 112 return super.hashCode(); 113 } 114 115 } 116 | Popular Tags |