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 ShippingInfo {
021        public static final String LINE_ID_SHIPPING_INFO = "SIN";
022
023        private String shipperId;
024
025        private String shippingTypeId;
026
027        private String shippingInfo;
028
029        public String getShipperId() {
030                return shipperId;
031        }
032
033        public void setShipperId(String shipperId) {
034                this.shipperId = shipperId;
035        }
036
037        public String getShippingInfo() {
038                return shippingInfo;
039        }
040
041        public void setShippingInfo(String shippingInfo) {
042                this.shippingInfo = shippingInfo;
043        }
044
045        public String getShippingTypeId() {
046                return shippingTypeId;
047        }
048
049        public void setShippingTypeId(String shippingTypeId) {
050                this.shippingTypeId = shippingTypeId;
051        }
052
053        @Override
054        public int hashCode() {
055                final int prime = 31;
056                int result = 1;
057                result = prime * result + ((shipperId == null) ? 0 : shipperId.hashCode());
058                result = prime * result + ((shippingInfo == null) ? 0 : shippingInfo.hashCode());
059                result = prime * result + ((shippingTypeId == null) ? 0 : shippingTypeId.hashCode());
060                return result;
061        }
062
063        @Override
064        public boolean equals(Object obj) {
065                if (this == obj) {
066                        return true;
067                }
068                if (obj == null) {
069                        return false;
070                }
071                if (getClass() != obj.getClass()) {
072                        return false;
073                }
074                ShippingInfo other = (ShippingInfo) obj;
075                if (shipperId == null) {
076                        if (other.shipperId != null) {
077                                return false;
078                        }
079                }
080                else if (!shipperId.equals(other.shipperId)) {
081                        return false;
082                }
083                if (shippingInfo == null) {
084                        if (other.shippingInfo != null) {
085                                return false;
086                        }
087                }
088                else if (!shippingInfo.equals(other.shippingInfo)) {
089                        return false;
090                }
091                if (shippingTypeId == null) {
092                        if (other.shippingTypeId != null) {
093                                return false;
094                        }
095                }
096                else if (!shippingTypeId.equals(other.shippingTypeId)) {
097                        return false;
098                }
099
100                return true;
101        }
102}