001/* Copyright (C) 2014 konik.io
002 *
003 * This file is part of the Konik library.
004 *
005 * The Konik library is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * The Konik library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with the Konik library. If not, see <http://www.gnu.org/licenses/>.
017 */
018package io.konik.zugferd.entity.trade.item;
019
020import java.io.Serializable;
021
022import javax.validation.Valid;
023import javax.xml.bind.annotation.XmlAccessType;
024import javax.xml.bind.annotation.XmlAccessorType;
025import javax.xml.bind.annotation.XmlElement;
026import javax.xml.bind.annotation.XmlType;
027
028import io.konik.validator.annotation.Comfort;
029import io.konik.zugferd.entity.PositionDocument;
030import io.konik.zugferd.entity.Product;
031
032/**
033 * = The Trade Item.
034 * 
035 */
036@XmlAccessorType(XmlAccessType.FIELD)
037@XmlType(name = "SupplyChainTradeLineItemType", propOrder = { "position", "agreement", "delivery", "settlement",
038      "product" })
039public class Item implements Serializable {
040
041   @XmlElement(name = "AssociatedDocumentLineDocument")
042   private PositionDocument position;
043
044   @XmlElement(name = "SpecifiedSupplyChainTradeAgreement")
045   private SpecifiedAgreement agreement;
046
047   @XmlElement(name = "SpecifiedSupplyChainTradeDelivery")
048   private SpecifiedDelivery delivery;
049
050   @XmlElement(name = "SpecifiedSupplyChainTradeSettlement")
051   private SpecifiedSettlement settlement;
052
053   @XmlElement(name = "SpecifiedTradeProduct")
054   private Product product;
055
056   /**
057    * Gets the item Line number.
058    *
059    * @return the position
060    */
061   @Comfort
062   @Valid
063   //@NotNull(groups = Comfort.class)
064   public PositionDocument getPosition() {
065      return position;
066   }
067
068   /**
069    * Sets the new item Line number.
070    *
071    * @param newPosition the new Line number.
072    * @return the trade item
073    */
074   public Item setPosition(PositionDocument newPosition) {
075      this.position = newPosition;
076      return this;
077   }
078
079   /**
080    * Gets the item level agreement.
081    *
082    * @return the item level agreement
083    */
084   @Valid
085   public SpecifiedAgreement getAgreement() {
086      return agreement;
087   }
088
089   /**
090    * Sets the item level agreement.
091    *
092    * @param newItemAgreement the new the item level agreement.
093    * @return the trade item
094    */
095   public Item setAgreement(SpecifiedAgreement newItemAgreement) {
096      this.agreement = newItemAgreement;
097      return this;
098   }
099
100   /**
101    * Gets item level delivery.
102    *
103    * @return the item level delivery
104    */
105   @Valid
106   public SpecifiedDelivery getDelivery() {
107      return delivery;
108   }
109
110   /**
111    * Sets item level delivery.
112    *
113    * @param newItemDelivery the new item level delivery
114    * @return the trade item
115    */
116   public Item setDelivery(SpecifiedDelivery newItemDelivery) {
117      this.delivery = newItemDelivery;
118      return this;
119   }
120
121   /**
122    * Gets the item level settlement.
123    *
124    * @return the item level settlement
125    */
126   @Valid
127   public SpecifiedSettlement getSettlement() {
128      return settlement;
129   }
130
131   /**
132    * Sets the item level settlement.
133    *
134    * @param newItemSettlement the new item level settlement
135    * @return the trade item
136    */
137   public Item setSettlement(SpecifiedSettlement newItemSettlement) {
138      this.settlement = newItemSettlement;
139      return this;
140   }
141
142   /**
143    * Gets the trade product.
144    *
145    * @return the product
146    */
147   @Valid
148   public Product getProduct() {
149      return product;
150   }
151
152   /**
153    * Sets the trade product.
154    *
155    * @param newProduct the product
156    * @return the trade item
157    */
158   public Item setProduct(Product newProduct) {
159      this.product = newProduct;
160      return this;
161   }
162}