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.person; 017 018public class Child { 019 private String name; 020 021 public void setName(String name){ 022 this.name = name; 023 } 024 025 public String getName(){ 026 return name; 027 } 028 029 @Override 030 public String toString() { 031 return "Child [name=" + name + "]"; 032 } 033 034 @Override 035 public int hashCode() { 036 final int prime = 31; 037 int result = 1; 038 result = prime * result + ((name == null) ? 0 : name.hashCode()); 039 return result; 040 } 041 042 @Override 043 public boolean equals(Object obj) { 044 if (this == obj) { 045 return true; 046 } 047 048 if (obj == null) { 049 return false; 050 } 051 052 if (getClass() != obj.getClass()) { 053 return false; 054 } 055 056 Child other = (Child) obj; 057 058 if (name == null) { 059 if (other.name != null) { 060 return false; 061 } 062 } 063 else if (!name.equals(other.name)) { 064 return false; 065 } 066 067 return true; 068 } 069}