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 io.konik.validator.annotation.Comfort; 021import io.konik.zugferd.entity.PositionDocument; 022import io.konik.zugferd.entity.Product; 023 024import javax.validation.Valid; 025import javax.xml.bind.annotation.XmlAccessType; 026import javax.xml.bind.annotation.XmlAccessorType; 027import javax.xml.bind.annotation.XmlElement; 028import javax.xml.bind.annotation.XmlType; 029 030/** 031 * = The Trade Item. 032 * 033 */ 034@XmlAccessorType(XmlAccessType.FIELD) 035@XmlType(name = "SupplyChainTradeLineItemType", propOrder = { "position", "agreement", "delivery", "settlement", 036 "product" }) 037public class Item { 038 039 @XmlElement(name = "AssociatedDocumentLineDocument") 040 private PositionDocument position; 041 042 @XmlElement(name = "SpecifiedSupplyChainTradeAgreement") 043 private SpecifiedAgreement agreement; 044 045 @XmlElement(name = "SpecifiedSupplyChainTradeDelivery") 046 private SpecifiedDelivery delivery; 047 048 @XmlElement(name = "SpecifiedSupplyChainTradeSettlement") 049 private SpecifiedSettlement settlement; 050 051 @XmlElement(name = "SpecifiedTradeProduct") 052 private Product product; 053 054 /** 055 * Gets the item position document. 056 * 057 * @return the position 058 */ 059 @Comfort 060 @Valid 061 public PositionDocument getPosition() { 062 return position; 063 } 064 065 /** 066 * Sets the new item position document. 067 * 068 * @param newPosition the new position 069 * @return the trade item 070 */ 071 public Item setPosition(PositionDocument newPosition) { 072 this.position = newPosition; 073 return this; 074 } 075 076 /** 077 * Gets the item level agreement. 078 * 079 * @return the item level agreement 080 */ 081 @Valid 082 public SpecifiedAgreement getAgreement() { 083 return agreement; 084 } 085 086 /** 087 * Sets the item level agreement. 088 * 089 * @param newItemAgreement the new the item level agreement. 090 * @return the trade item 091 */ 092 public Item setAgreement(SpecifiedAgreement newItemAgreement) { 093 this.agreement = newItemAgreement; 094 return this; 095 } 096 097 /** 098 * Gets item level delivery. 099 * 100 * @return the item level delivery 101 */ 102 @Valid 103 public SpecifiedDelivery getDelivery() { 104 return delivery; 105 } 106 107 /** 108 * Sets item level delivery. 109 * 110 * @param newItemDelivery the new item level delivery 111 * @return the trade item 112 */ 113 public Item setDelivery(SpecifiedDelivery newItemDelivery) { 114 this.delivery = newItemDelivery; 115 return this; 116 } 117 118 /** 119 * Gets the item level settlement. 120 * 121 * @return the item level settlement 122 */ 123 @Valid 124 public SpecifiedSettlement getSettlement() { 125 return settlement; 126 } 127 128 /** 129 * Sets the item level settlement. 130 * 131 * @param newItemSettlement the new item level settlement 132 * @return the trade item 133 */ 134 public Item setSettlement(SpecifiedSettlement newItemSettlement) { 135 this.settlement = newItemSettlement; 136 return this; 137 } 138 139 /** 140 * Gets the trade product. 141 * 142 * @return the product 143 */ 144 @Valid 145 public Product getProduct() { 146 return product; 147 } 148 149 /** 150 * Sets the trade product. 151 * 152 * @param newProduct the product 153 * @return the trade item 154 */ 155 public Item setProduct(Product newProduct) { 156 this.product = newProduct; 157 return this; 158 } 159}