001: /*
002: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018: package org.mandarax.examples.crm.domainmodel;
019:
020: /**
021: * Represents kinds of payment, like VISA, AMEX, cash etc.
022: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
023: * @version 3.4 <7 March 05>
024: * @since 1.2
025: */
026: public class KindOfPayment extends BusinessObject {
027:
028: public final static KindOfPayment COMPANY_VISA = new KindOfPayment(
029: "Company Visa Card");
030: public final static KindOfPayment OTHER_VISA = new KindOfPayment(
031: "Other Visa Card");
032: public final static KindOfPayment MASTER = new KindOfPayment(
033: "Master Card");
034: public final static KindOfPayment AMEX = new KindOfPayment(
035: "American Express");
036: public final static KindOfPayment DISCOVERY = new KindOfPayment(
037: "Discovery");
038: public final static KindOfPayment EURO = new KindOfPayment(
039: "Eurocard");
040: private String description = "?";
041:
042: /**
043: * Constructor.
044: */
045: public KindOfPayment() {
046: super ();
047: }
048:
049: /**
050: * Constructor.
051: * @param aDescription java.lang.String
052: */
053: public KindOfPayment(String aDescription) {
054: super ();
055: description = aDescription;
056: }
057:
058: /**
059: * Compares objects.
060: * @return boolean
061: * @param obj java.lang.Object
062: */
063: public boolean equals(Object obj) {
064: return (obj != null && (obj instanceof KindOfPayment) && ((KindOfPayment) obj).description
065: .equals(description));
066: }
067:
068: /**
069: * Get the description.
070: * @return java.lang.String
071: */
072: public String getDescription() {
073: return description;
074: }
075:
076: /**
077: * Get the hash code of the object.
078: * @return int
079: */
080: public int hashCode() {
081: return (description == null) ? 0 : description.hashCode();
082: }
083:
084: /**
085: * Set a description.
086: * @param value the new value
087: */
088: public void setDescription(String value) {
089: description = value;
090: }
091:
092: /**
093: * Convert the object to a string.
094: * @return java.lang.String
095: */
096: public String toString() {
097: return getDescription();
098: }
099:
100: }
|