001/* 002 * Copyright 2006-2014 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.batch.sample.domain.football; 018 019import java.io.Serializable; 020 021@SuppressWarnings("serial") 022public class Game implements Serializable { 023 024 private String id; 025 private int year; 026 private String team; 027 private int week; 028 private String opponent; 029 private int completes; 030 private int attempts; 031 private int passingYards; 032 private int passingTd; 033 private int interceptions; 034 private int rushes; 035 private int rushYards; 036 private int receptions; 037 private int receptionYards; 038 private int totalTd; 039 /** 040 * @return the id 041 */ 042 public String getId() { 043 return id; 044 } 045 /** 046 * @return the year 047 */ 048 public int getYear() { 049 return year; 050 } 051 /** 052 * @return the team 053 */ 054 public String getTeam() { 055 return team; 056 } 057 /** 058 * @return the week 059 */ 060 public int getWeek() { 061 return week; 062 } 063 /** 064 * @return the opponent 065 */ 066 public String getOpponent() { 067 return opponent; 068 } 069 /** 070 * @return the completes 071 */ 072 public int getCompletes() { 073 return completes; 074 } 075 /** 076 * @return the attempts 077 */ 078 public int getAttempts() { 079 return attempts; 080 } 081 /** 082 * @return the passingYards 083 */ 084 public int getPassingYards() { 085 return passingYards; 086 } 087 /** 088 * @return the passingTd 089 */ 090 public int getPassingTd() { 091 return passingTd; 092 } 093 /** 094 * @return the interceptions 095 */ 096 public int getInterceptions() { 097 return interceptions; 098 } 099 /** 100 * @return the rushes 101 */ 102 public int getRushes() { 103 return rushes; 104 } 105 /** 106 * @return the rushYards 107 */ 108 public int getRushYards() { 109 return rushYards; 110 } 111 /** 112 * @return the receptions 113 */ 114 public int getReceptions() { 115 return receptions; 116 } 117 /** 118 * @return the receptionYards 119 */ 120 public int getReceptionYards() { 121 return receptionYards; 122 } 123 /** 124 * @return the totalTd 125 */ 126 public int getTotalTd() { 127 return totalTd; 128 } 129 /** 130 * @param id the id to set 131 */ 132 public void setId(String id) { 133 this.id = id; 134 } 135 /** 136 * @param year the year to set 137 */ 138 public void setYear(int year) { 139 this.year = year; 140 } 141 /** 142 * @param team the team to set 143 */ 144 public void setTeam(String team) { 145 this.team = team; 146 } 147 /** 148 * @param week the week to set 149 */ 150 public void setWeek(int week) { 151 this.week = week; 152 } 153 /** 154 * @param opponent the opponent to set 155 */ 156 public void setOpponent(String opponent) { 157 this.opponent = opponent; 158 } 159 /** 160 * @param completes the completes to set 161 */ 162 public void setCompletes(int completes) { 163 this.completes = completes; 164 } 165 /** 166 * @param attempts the attempts to set 167 */ 168 public void setAttempts(int attempts) { 169 this.attempts = attempts; 170 } 171 /** 172 * @param passingYards the passingYards to set 173 */ 174 public void setPassingYards(int passingYards) { 175 this.passingYards = passingYards; 176 } 177 /** 178 * @param passingTd the passingTd to set 179 */ 180 public void setPassingTd(int passingTd) { 181 this.passingTd = passingTd; 182 } 183 /** 184 * @param interceptions the interceptions to set 185 */ 186 public void setInterceptions(int interceptions) { 187 this.interceptions = interceptions; 188 } 189 /** 190 * @param rushes the rushes to set 191 */ 192 public void setRushes(int rushes) { 193 this.rushes = rushes; 194 } 195 /** 196 * @param rushYards the rushYards to set 197 */ 198 public void setRushYards(int rushYards) { 199 this.rushYards = rushYards; 200 } 201 /** 202 * @param receptions the receptions to set 203 */ 204 public void setReceptions(int receptions) { 205 this.receptions = receptions; 206 } 207 /** 208 * @param receptionYards the receptionYards to set 209 */ 210 public void setReceptionYards(int receptionYards) { 211 this.receptionYards = receptionYards; 212 } 213 /** 214 * @param totalTd the totalTd to set 215 */ 216 public void setTotalTd(int totalTd) { 217 this.totalTd = totalTd; 218 } 219 220 221 @Override 222 public String toString() { 223 224 return "Game: ID=" + id + " " + team + " vs. " + opponent + 225 " - " + year; 226 } 227 228 @Override 229 public int hashCode() { 230 final int prime = 31; 231 int result = 1; 232 result = prime * result + ((id == null) ? 0 : id.hashCode()); 233 return result; 234 } 235 @Override 236 public boolean equals(Object obj) { 237 if (this == obj) { 238 return true; 239 } 240 if (obj == null) { 241 return false; 242 } 243 if (getClass() != obj.getClass()) { 244 return false; 245 } 246 Game other = (Game) obj; 247 if (id == null) { 248 if (other.id != null) { 249 return false; 250 } 251 } 252 else if (!id.equals(other.id)) { 253 return false; 254 } 255 256 return true; 257 } 258 259}