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