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.internal.xml;
018
019import java.util.Date;
020import java.util.List;
021
022/**
023 * An XML order.
024 * 
025 * This is a complex type.
026 */
027public class Order {
028        private Customer customer;
029
030        private Date date;
031
032        private List<LineItem> lineItems;
033
034        private Shipper shipper;
035
036        public Customer getCustomer() {
037                return customer;
038        }
039
040        public void setCustomer(Customer customer) {
041                this.customer = customer;
042        }
043
044        public Date getDate() {
045                return date != null ? new Date(date.getTime()) : null;
046        }
047
048        public void setDate(Date date) {
049                this.date = date != null ? new Date(date.getTime()) : null;
050        }
051
052        public List<LineItem> getLineItems() {
053                return lineItems;
054        }
055
056        public void setLineItems(List<LineItem> lineItems) {
057                this.lineItems = lineItems;
058        }
059
060        public Shipper getShipper() {
061                return shipper;
062        }
063
064        public void setShipper(Shipper shipper) {
065                this.shipper = shipper;
066        }
067
068        @Override
069        public String toString() {
070                return "Order [customer=" + customer + ", date=" + date + ", lineItems=" + lineItems + "]";
071        }
072
073}