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;
019
020import io.konik.zugferd.entity.trade.Agreement;
021import io.konik.zugferd.entity.trade.item.SpecifiedAgreement;
022
023import javax.xml.bind.annotation.XmlTransient;
024import javax.xml.bind.annotation.XmlType;
025import java.io.Serializable;
026import java.util.List;
027
028/**
029 * = The Agreement
030 * 
031 * This base agreement class contain only fields. {@link Agreement} and {@link SpecifiedAgreement} provide a different
032 * view
033 * on the underlying Data,
034 * we have this common field structure class because otherwise we would have two +SupplyChainTradeAgreementType+s and
035 * this is not allowed in JaxB
036 * 
037 * @param <R> the different Referenced Document
038 * @param <A> additional Referenced Document
039 */
040@XmlTransient
041@XmlType(name = "SupplyChainTradeAgreementType")
042public interface CommonAgreement<R extends ReferencedDocument, A extends ReferencedDocument> extends Serializable {
043   /**
044    * Gets the buyer order referenced document.
045    *
046    * @return the buyer order referenced document
047    */
048   R getBuyerOrder();
049
050   /**
051    * Sets the buyer order referenced document.
052    *
053    * @param buyerOrder the new buyer order referenced document
054    * @return the supply chain trade agreement
055    */
056   CommonAgreement<R, A> setBuyerOrder(R buyerOrder);
057
058   /**
059    * Gets the contract referenced document.
060    * 
061    *
062    * @return the contract referenced document
063    */
064   R getContract();
065
066   /**
067    * Sets the contract referenced document.
068    * 
069    *
070    * @param contract the new contract referenced document
071    * @return the supply chain trade agreement
072    */
073   CommonAgreement<R, A> setContract(R contract);
074
075   /**
076    * Gets the additional referenced document
077    *
078    * @return the additional
079    */
080   List<A> getAdditional();
081
082   /**
083    * Sets the additional referenced document.
084    *
085    * @param additionalReference the additional reference
086    * @return the common agreement
087    */
088   CommonAgreement<R, A> addAdditional(A additionalReference);
089
090   /**
091    * Gets the customer order referenced document.
092    * 
093    *
094    * @return the customer order referenced document
095    */
096   R getCustomerOrder();
097
098   /**
099    * Sets the customer order referenced document.
100    * 
101    *
102    * @param customerOrder the new customer order referenced document
103    * @return the supply chain trade agreement
104    */
105   CommonAgreement<R, A> setCustomerOrder(R customerOrder);
106
107}