001/* 002 * Copyright (C) 2014 konik.io 003 * 004 * This file is part of Konik library. 005 * 006 * Konik library is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU Affero General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * Konik library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU Affero General Public License for more details. 015 * 016 * You should have received a copy of the GNU Affero General Public License 017 * along with Konik library. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package io.konik.zugferd.entity; 020 021import io.konik.zugferd.unqualified.Quantity; 022 023import javax.validation.Valid; 024import javax.validation.constraints.NotNull; 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/** 032 * = The Trade Delivery 033 * 034 */ 035@XmlAccessorType(XmlAccessType.FIELD) 036@XmlType(name = "SupplyChainTradeDeliveryType", propOrder = { "billedQuantity", "event", "note" }) 037public class Delivery { 038 039 @Valid@NotNull 040 @XmlElement(name = "BilledQuantity") 041 private Quantity billedQuantity; 042 043 @Valid 044 @XmlElement(name = "ActualDeliverySupplyChainEvent") 045 private Event event; 046 047 @Valid 048 @XmlElement(name = "DeliveryNoteReferencedDocument") 049 private ReferencedDocument note; 050 051 /** Instantiates a new trade delivery. */ 052 public Delivery() { 053 } 054 055 /** 056 * Instantiates a new trade delivery. 057 * 058 * @param billedQuantity the billed quantity 059 * @param deliveryEvent the event 060 */ 061 public Delivery(Quantity billedQuantity, Event deliveryEvent) { 062 this.billedQuantity = billedQuantity; 063 this.event = deliveryEvent; 064 } 065 066 /** 067 * Gets the billed quantity. 068 * 069 * Profile:: BASIC 070 * 071 * @return the billed quantity 072 */ 073 public Quantity getBilledQuantity() { 074 return billedQuantity; 075 } 076 077 /** 078 * Sets the billed quantity. 079 * 080 * Profile:: BASIC 081 * 082 * @param billedQuantity the new billed quantity 083 * @return the delivery 084 */ 085 public Delivery setBilledQuantity(Quantity billedQuantity) { 086 this.billedQuantity = billedQuantity; 087 return this; 088 } 089 090 /** 091 * Gets the actual delivery event. 092 * 093 * @return the actual delivery event 094 */ 095 public Event getEvent() { 096 return event; 097 } 098 099 /** 100 * Sets the actual delivery event. 101 * 102 * @param deliveryEvent the new actual delivery event 103 * @return the trade delivery 104 */ 105 public Delivery setEvent(Event deliveryEvent) { 106 this.event = deliveryEvent; 107 return this; 108 } 109 110 /** 111 * Gets the delivery note referenced document. 112 * 113 * @return the delivery note referenced document 114 */ 115 public ReferencedDocument getNote() { 116 return note; 117 } 118 119 /** 120 * Sets the note. 121 * 122 * @param note the new delivery note referenced document 123 * @return the delivery 124 */ 125 public Delivery setNote(ReferencedDocument note) { 126 this.note = note; 127 return this; 128 } 129 130}