| 1 7 package xpetstore.domain; 8 9 import java.io.Serializable ; 10 11 12 15 public class CreditCard 16 implements Serializable  17 { 18 20 public static final String VISA = "Visa"; 21 public static final String MASTERCARD = "MasterCard"; 22 public static final String AMEX = "American Express"; 23 24 26 private String _number = ""; 27 private String _type = ""; 28 private String _expiryDate = ""; 29 30 32 public CreditCard( ) 33 { 34 super( ); 35 } 36 37 public CreditCard( CreditCard cc ) 38 { 39 set( cc ); 40 } 41 42 44 51 public String getExpiryDate( ) 52 { 53 return _expiryDate; 54 } 55 56 63 public String getNumber( ) 64 { 65 return _number; 66 } 67 68 75 public String getType( ) 76 { 77 return _type; 78 } 79 80 public void set( CreditCard cc ) 81 { 82 _type = cc.getType( ); 83 _number = cc.getNumber( ); 84 _expiryDate = cc.getExpiryDate( ); 85 } 86 87 91 public void setExpiryDate( String expiryDate ) 92 { 93 _expiryDate = expiryDate; 94 } 95 96 100 public void setNumber( String number ) 101 { 102 _number = number; 103 } 104 105 109 public void setType( String type ) 110 { 111 _type = type; 112 } 113 } 114 | Popular Tags |