View Javadoc

1   /*
2    * Copyright 2006-2007 the original author or authors.
3    *
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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  
17  package org.springframework.batch.sample.domain.football;
18  
19  import java.io.Serializable;
20  
21  public class Game implements Serializable {
22  	
23  	private String id;
24  	private int year;
25  	private String team;
26  	private int week;
27  	private String opponent;
28  	private int completes;
29  	private int attempts;
30  	private int passingYards;
31  	private int passingTd;
32  	private int interceptions;
33  	private int rushes;
34  	private int rushYards;
35  	private int receptions;
36  	private int receptionYards;
37  	private int totalTd;
38  	/**
39  	 * @return the id
40  	 */
41  	public String getId() {
42  		return id;
43  	}
44  	/**
45  	 * @return the year
46  	 */
47  	public int getYear() {
48  		return year;
49  	}
50  	/**
51  	 * @return the team
52  	 */
53  	public String getTeam() {
54  		return team;
55  	}
56  	/**
57  	 * @return the week
58  	 */
59  	public int getWeek() {
60  		return week;
61  	}
62  	/**
63  	 * @return the opponent
64  	 */
65  	public String getOpponent() {
66  		return opponent;
67  	}
68  	/**
69  	 * @return the completes
70  	 */
71  	public int getCompletes() {
72  		return completes;
73  	}
74  	/**
75  	 * @return the attempts
76  	 */
77  	public int getAttempts() {
78  		return attempts;
79  	}
80  	/**
81  	 * @return the passingYards
82  	 */
83  	public int getPassingYards() {
84  		return passingYards;
85  	}
86  	/**
87  	 * @return the passingTd
88  	 */
89  	public int getPassingTd() {
90  		return passingTd;
91  	}
92  	/**
93  	 * @return the interceptions
94  	 */
95  	public int getInterceptions() {
96  		return interceptions;
97  	}
98  	/**
99  	 * @return the rushes
100 	 */
101 	public int getRushes() {
102 		return rushes;
103 	}
104 	/**
105 	 * @return the rushYards
106 	 */
107 	public int getRushYards() {
108 		return rushYards;
109 	}
110 	/**
111 	 * @return the receptions
112 	 */
113 	public int getReceptions() {
114 		return receptions;
115 	}
116 	/**
117 	 * @return the receptionYards
118 	 */
119 	public int getReceptionYards() {
120 		return receptionYards;
121 	}
122 	/**
123 	 * @return the totalTd
124 	 */
125 	public int getTotalTd() {
126 		return totalTd;
127 	}
128 	/**
129 	 * @param id the id to set
130 	 */
131 	public void setId(String id) {
132 		this.id = id;
133 	}
134 	/**
135 	 * @param year the year to set
136 	 */
137 	public void setYear(int year) {
138 		this.year = year;
139 	}
140 	/**
141 	 * @param team the team to set
142 	 */
143 	public void setTeam(String team) {
144 		this.team = team;
145 	}
146 	/**
147 	 * @param week the week to set
148 	 */
149 	public void setWeek(int week) {
150 		this.week = week;
151 	}
152 	/**
153 	 * @param opponent the opponent to set
154 	 */
155 	public void setOpponent(String opponent) {
156 		this.opponent = opponent;
157 	}
158 	/**
159 	 * @param completes the completes to set
160 	 */
161 	public void setCompletes(int completes) {
162 		this.completes = completes;
163 	}
164 	/**
165 	 * @param attempts the attempts to set
166 	 */
167 	public void setAttempts(int attempts) {
168 		this.attempts = attempts;
169 	}
170 	/**
171 	 * @param passingYards the passingYards to set
172 	 */
173 	public void setPassingYards(int passingYards) {
174 		this.passingYards = passingYards;
175 	}
176 	/**
177 	 * @param passingTd the passingTd to set
178 	 */
179 	public void setPassingTd(int passingTd) {
180 		this.passingTd = passingTd;
181 	}
182 	/**
183 	 * @param interceptions the interceptions to set
184 	 */
185 	public void setInterceptions(int interceptions) {
186 		this.interceptions = interceptions;
187 	}
188 	/**
189 	 * @param rushes the rushes to set
190 	 */
191 	public void setRushes(int rushes) {
192 		this.rushes = rushes;
193 	}
194 	/**
195 	 * @param rushYards the rushYards to set
196 	 */
197 	public void setRushYards(int rushYards) {
198 		this.rushYards = rushYards;
199 	}
200 	/**
201 	 * @param receptions the receptions to set
202 	 */
203 	public void setReceptions(int receptions) {
204 		this.receptions = receptions;
205 	}
206 	/**
207 	 * @param receptionYards the receptionYards to set
208 	 */
209 	public void setReceptionYards(int receptionYards) {
210 		this.receptionYards = receptionYards;
211 	}
212 	/**
213 	 * @param totalTd the totalTd to set
214 	 */
215 	public void setTotalTd(int totalTd) {
216 		this.totalTd = totalTd;
217 	}
218 	
219 	
220 	public String toString() {
221 
222 		return "Game: ID=" + id + " " + team + " vs. " + opponent + 
223 		" - " + year;
224 	}
225 
226 	@Override
227 	public int hashCode() {
228 		final int prime = 31;
229 		int result = 1;
230 		result = prime * result + ((id == null) ? 0 : id.hashCode());
231 		return result;
232 	}
233 	@Override
234 	public boolean equals(Object obj) {
235 		if (this == obj)
236 			return true;
237 		if (obj == null)
238 			return false;
239 		if (getClass() != obj.getClass())
240 			return false;
241 		Game other = (Game) obj;
242 		if (id == null) {
243 			if (other.id != null)
244 				return false;
245 		}
246 		else if (!id.equals(other.id))
247 			return false;
248 		return true;
249 	}
250 		
251 }