View Javadoc
1   package org.springframework.expression.spel.testresources;
2   
3   ///CLOVER:OFF
4   public class PlaceOfBirth {
5   	private String city;
6   
7   	public String Country;
8   
9   	/**
10  	 * Keith now has a converter that supports String to X, if X has a ctor that takes a String.
11  	 * In order for round tripping to work we need toString() for X to return what it was
12  	 * constructed with.  This is a bit of a hack because a PlaceOfBirth also encapsulates a
13  	 * country - but as it is just a test object, it is ok.
14  	 */
15  	@Override
16  	public String toString() {return city;}
17  
18  	public String getCity() {
19  		return city;
20  	}
21  	public void setCity(String s) {
22  		this.city = s;
23  	}
24  
25  	public PlaceOfBirth(String string) {
26  		this.city=string;
27  	}
28  
29  	public int doubleIt(int i) {
30  		return i*2;
31  	}
32  
33  	@Override
34  	public boolean equals(Object o) {
35  		if (!(o instanceof PlaceOfBirth)) {
36  			return false;
37  		}
38  		PlaceOfBirth oPOB = (PlaceOfBirth)o;
39  		return (city.equals(oPOB.city));
40  	}
41  
42  	@Override
43  	public int hashCode() {
44  		return city.hashCode();
45  	}
46  
47  }