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 */
016
017package org.springframework.batch.sample.domain.order;
018
019
020public class BillingInfo {
021        public static final String LINE_ID_BILLING_INFO = "BIN";
022
023        private String paymentId;
024
025        private String paymentDesc;
026
027        public String getPaymentDesc() {
028                return paymentDesc;
029        }
030
031        public void setPaymentDesc(String paymentDesc) {
032                this.paymentDesc = paymentDesc;
033        }
034
035        public String getPaymentId() {
036                return paymentId;
037        }
038
039        public void setPaymentId(String paymentId) {
040                this.paymentId = paymentId;
041        }
042
043        @Override
044        public String toString() {
045                return "BillingInfo [paymentDesc=" + paymentDesc + ", paymentId=" + paymentId + "]";
046        }
047
048        @Override
049        public int hashCode() {
050                final int prime = 31;
051                int result = 1;
052                result = prime * result + ((paymentDesc == null) ? 0 : paymentDesc.hashCode());
053                result = prime * result + ((paymentId == null) ? 0 : paymentId.hashCode());
054                return result;
055        }
056
057        @Override
058        public boolean equals(Object obj) {
059                if (this == obj) {
060                        return true;
061                }
062                if (obj == null) {
063                        return false;
064                }
065                if (getClass() != obj.getClass()) {
066                        return false;
067                }
068                BillingInfo other = (BillingInfo) obj;
069                if (paymentDesc == null) {
070                        if (other.paymentDesc != null) {
071                                return false;
072                        }
073                }
074                else if (!paymentDesc.equals(other.paymentDesc)) {
075                        return false;
076                }
077                if (paymentId == null) {
078                        if (other.paymentId != null) {
079                                return false;
080                        }
081                }
082                else if (!paymentId.equals(other.paymentId)) {
083                        return false;
084                }
085
086                return true;
087        }
088}