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  
20  /**
21   * Domain object representing the summary of a given Player's 
22   * year.
23   * 
24   * @author Lucas Ward
25   *
26   */
27  public class PlayerSummary {
28  
29  	private String id;
30  	private int year;
31  	private int completes;
32  	private int attempts;
33  	private int passingYards;
34  	private int passingTd;
35  	private int interceptions;
36  	private int rushes;
37  	private int rushYards;
38  	private int receptions;
39  	private int receptionYards;
40  	private int totalTd;
41  	
42  	public String getId() {
43  		return id;
44  	}
45  	public void setId(String id) {
46  		this.id = id;
47  	}
48  	public int getYear() {
49  		return year;
50  	}
51  	public void setYear(int year) {
52  		this.year = year;
53  	}
54  	public int getCompletes() {
55  		return completes;
56  	}
57  	public void setCompletes(int completes) {
58  		this.completes = completes;
59  	}
60  	public int getAttempts() {
61  		return attempts;
62  	}
63  	public void setAttempts(int attempts) {
64  		this.attempts = attempts;
65  	}
66  	public int getPassingYards() {
67  		return passingYards;
68  	}
69  	public void setPassingYards(int passingYards) {
70  		this.passingYards = passingYards;
71  	}
72  	public int getPassingTd() {
73  		return passingTd;
74  	}
75  	public void setPassingTd(int passingTd) {
76  		this.passingTd = passingTd;
77  	}
78  	public int getInterceptions() {
79  		return interceptions;
80  	}
81  	public void setInterceptions(int interceptions) {
82  		this.interceptions = interceptions;
83  	}
84  	public int getRushes() {
85  		return rushes;
86  	}
87  	public void setRushes(int rushes) {
88  		this.rushes = rushes;
89  	}
90  	public int getRushYards() {
91  		return rushYards;
92  	}
93  	public void setRushYards(int rushYards) {
94  		this.rushYards = rushYards;
95  	}
96  	public int getReceptions() {
97  		return receptions;
98  	}
99  	public void setReceptions(int receptions) {
100 		this.receptions = receptions;
101 	}
102 	public int getReceptionYards() {
103 		return receptionYards;
104 	}
105 	public void setReceptionYards(int receptionYards) {
106 		this.receptionYards = receptionYards;
107 	}
108 	public int getTotalTd() {
109 		return totalTd;
110 	}
111 	public void setTotalTd(int totalTd) {
112 		this.totalTd = totalTd;
113 	}
114 	
115 	
116 	public String toString() {
117 		return "Player Summary: ID=" + id + " Year=" + year + "[" + completes + ";" + attempts + ";" + passingYards +
118 				";" + passingTd + ";" + interceptions + ";" + rushes + ";" + rushYards + ";" + receptions +
119 				";" + receptionYards + ";" + totalTd;
120 	}
121 	@Override
122 	public int hashCode() {
123 		final int prime = 31;
124 		int result = 1;
125 		result = prime * result + ((id == null) ? 0 : id.hashCode());
126 		return result;
127 	}
128 	@Override
129 	public boolean equals(Object obj) {
130 		if (this == obj)
131 			return true;
132 		if (obj == null)
133 			return false;
134 		if (getClass() != obj.getClass())
135 			return false;
136 		PlayerSummary other = (PlayerSummary) obj;
137 		if (id == null) {
138 			if (other.id != null)
139 				return false;
140 		}
141 		else if (!id.equals(other.id))
142 			return false;
143 		return true;
144 	}
145 		
146 }