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.order;
18  
19  
20  public class ShippingInfo {
21  	public static final String LINE_ID_SHIPPING_INFO = "SIN";
22  
23  	private String shipperId;
24  
25  	private String shippingTypeId;
26  
27  	private String shippingInfo;
28  
29  	public String getShipperId() {
30  		return shipperId;
31  	}
32  
33  	public void setShipperId(String shipperId) {
34  		this.shipperId = shipperId;
35  	}
36  
37  	public String getShippingInfo() {
38  		return shippingInfo;
39  	}
40  
41  	public void setShippingInfo(String shippingInfo) {
42  		this.shippingInfo = shippingInfo;
43  	}
44  
45  	public String getShippingTypeId() {
46  		return shippingTypeId;
47  	}
48  
49  	public void setShippingTypeId(String shippingTypeId) {
50  		this.shippingTypeId = shippingTypeId;
51  	}
52  
53  	@Override
54  	public int hashCode() {
55  		final int prime = 31;
56  		int result = 1;
57  		result = prime * result + ((shipperId == null) ? 0 : shipperId.hashCode());
58  		result = prime * result + ((shippingInfo == null) ? 0 : shippingInfo.hashCode());
59  		result = prime * result + ((shippingTypeId == null) ? 0 : shippingTypeId.hashCode());
60  		return result;
61  	}
62  
63  	@Override
64  	public boolean equals(Object obj) {
65  		if (this == obj)
66  			return true;
67  		if (obj == null)
68  			return false;
69  		if (getClass() != obj.getClass())
70  			return false;
71  		ShippingInfo other = (ShippingInfo) obj;
72  		if (shipperId == null) {
73  			if (other.shipperId != null)
74  				return false;
75  		}
76  		else if (!shipperId.equals(other.shipperId))
77  			return false;
78  		if (shippingInfo == null) {
79  			if (other.shippingInfo != null)
80  				return false;
81  		}
82  		else if (!shippingInfo.equals(other.shippingInfo))
83  			return false;
84  		if (shippingTypeId == null) {
85  			if (other.shippingTypeId != null)
86  				return false;
87  		}
88  		else if (!shippingTypeId.equals(other.shippingTypeId))
89  			return false;
90  		return true;
91  	}
92  
93  }