001/* 002 * Copyright 2006-2007 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.core.test.football; 018 019 020/** 021 * Domain object representing the summary of a given Player's 022 * year. 023 * 024 * @author Lucas Ward 025 * 026 */ 027public class PlayerSummary { 028 029 private String id; 030 private int year; 031 private int completes; 032 private int attempts; 033 private int passingYards; 034 private int passingTd; 035 private int interceptions; 036 private int rushes; 037 private int rushYards; 038 private int receptions; 039 private int receptionYards; 040 private int totalTd; 041 042 public String getId() { 043 return id; 044 } 045 public void setId(String id) { 046 this.id = id; 047 } 048 public int getYear() { 049 return year; 050 } 051 public void setYear(int year) { 052 this.year = year; 053 } 054 public int getCompletes() { 055 return completes; 056 } 057 public void setCompletes(int completes) { 058 this.completes = completes; 059 } 060 public int getAttempts() { 061 return attempts; 062 } 063 public void setAttempts(int attempts) { 064 this.attempts = attempts; 065 } 066 public int getPassingYards() { 067 return passingYards; 068 } 069 public void setPassingYards(int passingYards) { 070 this.passingYards = passingYards; 071 } 072 public int getPassingTd() { 073 return passingTd; 074 } 075 public void setPassingTd(int passingTd) { 076 this.passingTd = passingTd; 077 } 078 public int getInterceptions() { 079 return interceptions; 080 } 081 public void setInterceptions(int interceptions) { 082 this.interceptions = interceptions; 083 } 084 public int getRushes() { 085 return rushes; 086 } 087 public void setRushes(int rushes) { 088 this.rushes = rushes; 089 } 090 public int getRushYards() { 091 return rushYards; 092 } 093 public void setRushYards(int rushYards) { 094 this.rushYards = rushYards; 095 } 096 public int getReceptions() { 097 return receptions; 098 } 099 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 @Override 117 public String toString() { 118 return "Player Summary: ID=" + id + " Year=" + year + "[" + completes + ";" + attempts + ";" + passingYards + 119 ";" + passingTd + ";" + interceptions + ";" + rushes + ";" + rushYards + ";" + receptions + 120 ";" + receptionYards + ";" + totalTd; 121 } 122 @Override 123 public int hashCode() { 124 final int prime = 31; 125 int result = 1; 126 result = prime * result + ((id == null) ? 0 : id.hashCode()); 127 return result; 128 } 129 @Override 130 public boolean equals(Object obj) { 131 if (this == obj) 132 return true; 133 if (obj == null) 134 return false; 135 if (getClass() != obj.getClass()) 136 return false; 137 PlayerSummary other = (PlayerSummary) obj; 138 if (id == null) { 139 if (other.id != null) 140 return false; 141 } 142 else if (!id.equals(other.id)) 143 return false; 144 return true; 145 } 146 147}