View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.ksb.messaging.remotedservices;
17  
18  import javax.xml.bind.annotation.XmlRootElement;
19  
20  /**
21   * data bean used by the {@link BaseballCardCollectionService}
22   * 
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   *
25   */
26  @XmlRootElement
27  public class BaseballCard {
28      
29      private String cardType;
30      private String playerName;
31      private Integer year;
32      
33      public BaseballCard() {
34      }
35  
36      public BaseballCard(String playerName, String cardType, Integer year) {
37          this.playerName = playerName;
38          this.cardType = cardType;
39          this.year = year;
40      }
41  
42      
43      
44      /**
45       * @param cardType the cardType to set
46       */
47      public void setCardType(String cardType) {
48          this.cardType = cardType;
49      }
50  
51      /**
52       * @param playerName the playerName to set
53       */
54      public void setPlayerName(String playerName) {
55          this.playerName = playerName;
56      }
57  
58      /**
59       * @param year the year to set
60       */
61      public void setYear(Integer year) {
62          this.year = year;
63      }
64  
65      public String getCardType() {
66          return cardType;
67      }
68      
69      public String getPlayerName() {
70          return playerName;
71      }
72      
73      public Integer getYear() {
74          return year;
75      }
76  
77      /**
78       * @see java.lang.Object#hashCode()
79       */
80      @Override
81      public int hashCode() {
82          final int prime = 31;
83          int result = 1;
84          result = prime * result + ((this.cardType == null) ? 0 : this.cardType.hashCode());
85          result = prime * result + ((this.playerName == null) ? 0 : this.playerName.hashCode());
86          result = prime * result + ((this.year == null) ? 0 : this.year.hashCode());
87          return result;
88      }
89  
90      /**
91       * @see java.lang.Object#equals(java.lang.Object)
92       */
93      @Override
94      public boolean equals(Object obj) {
95          if (this == obj)
96              return true;
97          if (obj == null)
98              return false;
99          if (getClass() != obj.getClass())
100             return false;
101         BaseballCard other = (BaseballCard) obj;
102         if (this.cardType == null) {
103             if (other.cardType != null)
104                 return false;
105         } else if (!this.cardType.equals(other.cardType))
106             return false;
107         if (this.playerName == null) {
108             if (other.playerName != null)
109                 return false;
110         } else if (!this.playerName.equals(other.playerName))
111             return false;
112         if (this.year == null) {
113             if (other.year != null)
114                 return false;
115         } else if (!this.year.equals(other.year))
116             return false;
117         return true;
118     };
119     
120     
121 
122 }