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.person;
18  
19  
20  public class Child {
21  
22  	private String name;
23  	
24  	public void setName(String name){
25  		this.name = name;
26  	}
27  	
28  	public String getName(){
29  		return name;
30  	}
31  
32  	@Override
33  	public String toString() {
34  		return "Child [name=" + name + "]";
35  	}
36  
37  	@Override
38  	public int hashCode() {
39  		final int prime = 31;
40  		int result = 1;
41  		result = prime * result + ((name == null) ? 0 : name.hashCode());
42  		return result;
43  	}
44  
45  	@Override
46  	public boolean equals(Object obj) {
47  		if (this == obj)
48  			return true;
49  		if (obj == null)
50  			return false;
51  		if (getClass() != obj.getClass())
52  			return false;
53  		Child other = (Child) obj;
54  		if (name == null) {
55  			if (other.name != null)
56  				return false;
57  		}
58  		else if (!name.equals(other.name))
59  			return false;
60  		return true;
61  	}
62  		
63  }