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 BillingInfo {
21  	public static final String LINE_ID_BILLING_INFO = "BIN";
22  
23  	private String paymentId;
24  
25  	private String paymentDesc;
26  
27  	public String getPaymentDesc() {
28  		return paymentDesc;
29  	}
30  
31  	public void setPaymentDesc(String paymentDesc) {
32  		this.paymentDesc = paymentDesc;
33  	}
34  
35  	public String getPaymentId() {
36  		return paymentId;
37  	}
38  
39  	public void setPaymentId(String paymentId) {
40  		this.paymentId = paymentId;
41  	}
42  
43  	@Override
44  	public String toString() {
45  		return "BillingInfo [paymentDesc=" + paymentDesc + ", paymentId=" + paymentId + "]";
46  	}
47  
48  	@Override
49  	public int hashCode() {
50  		final int prime = 31;
51  		int result = 1;
52  		result = prime * result + ((paymentDesc == null) ? 0 : paymentDesc.hashCode());
53  		result = prime * result + ((paymentId == null) ? 0 : paymentId.hashCode());
54  		return result;
55  	}
56  
57  	@Override
58  	public boolean equals(Object obj) {
59  		if (this == obj)
60  			return true;
61  		if (obj == null)
62  			return false;
63  		if (getClass() != obj.getClass())
64  			return false;
65  		BillingInfo other = (BillingInfo) obj;
66  		if (paymentDesc == null) {
67  			if (other.paymentDesc != null)
68  				return false;
69  		}
70  		else if (!paymentDesc.equals(other.paymentDesc))
71  			return false;
72  		if (paymentId == null) {
73  			if (other.paymentId != null)
74  				return false;
75  		}
76  		else if (!paymentId.equals(other.paymentId))
77  			return false;
78  		return true;
79  	}
80  
81  }