KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ce > auction > model > CreditCardType


1 package org.hibernate.ce.auction.model;
2
3 public enum CreditCardType {
4
5     MASTERCARD(1, "Mastercard"),
6     VISA(2, "Visa"),
7     AMEX(3, "American Express");
8
9     private final int code;
10     private final String JavaDoc debugName;
11
12     private CreditCardType(int code, String JavaDoc debugName) {
13         this.debugName = debugName;
14         this.code = code;
15     }
16
17     public String JavaDoc toString() {
18         return debugName;
19     }
20
21     public int value() {
22         return code;
23     }
24
25     // ********************** Business Methods ********************** //
26

27     public boolean isValid(CreditCard cc) {
28         // TODO: Implement syntactical validation of credit card information.
29
return true;
30     }
31
32 }
Popular Tags