1 5 package com.openedit.store; 6 7 11 public class CreditCardType implements Comparable 12 { 13 protected String fieldName = ""; 14 protected String fieldId = ""; 15 16 public CreditCardType() 17 { 18 } 19 20 public CreditCardType( String inName ) 21 { 22 fieldName = inName; 23 } 24 25 public String getName() 26 { 27 if ( fieldName == null ) 28 { 29 fieldName = ""; 30 } 31 return fieldName; 32 } 33 34 public void setName(String inString) 35 { 36 fieldName = inString; 37 } 38 39 public String toString() 40 { 41 return fieldName; 42 } 43 44 public int compareTo(Object o) 45 { 46 if ( o instanceof CreditCardType ) 47 { 48 return getName().compareTo( ((CreditCardType) o).getName() ); 49 } 50 else 51 { 52 return -1; 53 } 54 } 55 56 public boolean equals( Object o ) 57 { 58 if ( o instanceof CreditCardType ) 59 { 60 return getName().equals( ((CreditCardType) o).getName() ); 61 } 62 else 63 { 64 return false; 65 } 66 } 67 68 public int hashCode() 69 { 70 return getName().hashCode(); 71 } 72 public String getId() { 73 return fieldId; 74 } 75 public void setId(String inId) { 76 fieldId = inId; 77 } 78 } 79 | Popular Tags |