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 java.util.List;
024
025import javax.xml.bind.annotation.XmlTransient;
026import javax.xml.bind.annotation.XmlType;
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> {
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    * Profile:: COMFORT
062    *
063    * @return the contract referenced document
064    */
065   R getContract();
066
067   /**
068    * Sets the contract referenced document.
069    * 
070    * Profile:: COMFORT
071    *
072    * @param contract the new contract referenced document
073    * @return the supply chain trade agreement
074    */
075   CommonAgreement<R, A> setContract(R contract);
076
077   /**
078    * Gets the additional referenced document
079    *
080    * @return the additional
081    */
082   List<A> getAdditional();
083
084   /**
085    * Sets the additional referenced document.
086    *
087    * @param additionalReference the additional reference
088    * @return the common agreement
089    */
090   CommonAgreement<R, A> addAdditional(A additionalReference);
091
092   /**
093    * Gets the customer order referenced document.
094    * 
095    * Profile:: COMFORT
096    *
097    * @return the customer order referenced document
098    */
099   R getCustomerOrder();
100
101   /**
102    * Sets the customer order referenced document.
103    * 
104    * Profile:: COMFORT
105    *
106    * @param customerOrder the new customer order referenced document
107    * @return the supply chain trade agreement
108    */
109   CommonAgreement<R, A> setCustomerOrder(R customerOrder);
110
111}