All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tectonica.jonix.onix2.SupplyDetail Maven / Gradle / Ivy

There is a newer version: 2024-10-onix308
Show newest version
/*
 * Copyright (C) 2012-2023 Zach Melamed
 *
 * Latest version available online at https://github.com/zach-m/jonix
 * Contact me at [email protected]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tectonica.jonix.onix2;

import com.tectonica.jonix.common.JPU;
import com.tectonica.jonix.common.ListOfOnixCodelist;
import com.tectonica.jonix.common.ListOfOnixComposite;
import com.tectonica.jonix.common.ListOfOnixDataComposite;
import com.tectonica.jonix.common.ListOfOnixDataCompositeWithKey;
import com.tectonica.jonix.common.ListOfOnixElement;
import com.tectonica.jonix.common.OnixComposite.OnixSuperComposite;
import com.tectonica.jonix.common.codelist.Countrys;
import com.tectonica.jonix.common.codelist.Languages;
import com.tectonica.jonix.common.codelist.RecordSourceTypes;
import com.tectonica.jonix.common.codelist.SupplierIdentifierTypes;
import com.tectonica.jonix.common.codelist.SupplytoRegions;
import com.tectonica.jonix.common.codelist.TextCaseFlags;
import com.tectonica.jonix.common.codelist.TextFormats;
import com.tectonica.jonix.common.codelist.TransliterationSchemes;
import com.tectonica.jonix.common.struct.JonixSupplierIdentifier;
import com.tectonica.jonix.common.struct.JonixWebsite;

import java.io.Serializable;
import java.util.function.Consumer;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
 */

/**
 * 

Supplier and trade data composite

*

* A repeatable group of data elements which together give details of a trade supply source and the product price and * availability from that source. *

* * * * * * * * * *
Reference name<SupplyDetail>
Short tag<supplydetail>
*

* This tag may be included in the following composites: *

    *
  • <{@link Product}>
  • *
*

* Possible placements within ONIX message: *

    *
  • {@link Product} ⯈ {@link SupplyDetail}
  • *
*/ public class SupplyDetail implements OnixSuperComposite, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "SupplyDetail"; public static final String shortname = "supplydetail"; ///////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES ///////////////////////////////////////////////////////////////////////////////// public TextFormats textformat; public TextCaseFlags textcase; public Languages language; public TransliterationSchemes transliteration; /** * (type: DateOrDateTime) */ public String datestamp; public RecordSourceTypes sourcetype; public String sourcename; ///////////////////////////////////////////////////////////////////////////////// // CONSTRUCTION ///////////////////////////////////////////////////////////////////////////////// private boolean initialized; private final boolean exists; private final org.w3c.dom.Element element; public static final SupplyDetail EMPTY = new SupplyDetail(); public SupplyDetail() { exists = false; element = null; initialized = true; // so that no further processing will be done on this intentionally-empty object } public SupplyDetail(org.w3c.dom.Element element) { exists = true; initialized = false; this.element = element; textformat = TextFormats.byCode(JPU.getAttribute(element, "textformat")); textcase = TextCaseFlags.byCode(JPU.getAttribute(element, "textcase")); language = Languages.byCode(JPU.getAttribute(element, "language")); transliteration = TransliterationSchemes.byCode(JPU.getAttribute(element, "transliteration")); datestamp = JPU.getAttribute(element, "datestamp"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); sourcename = JPU.getAttribute(element, "sourcename"); } @Override public void _initialize() { if (initialized) { return; } initialized = true; JPU.forElementsOf(element, e -> { final String name = e.getNodeName(); switch (name) { case SupplierEANLocationNumber.refname: case SupplierEANLocationNumber.shortname: supplierEANLocationNumber = new SupplierEANLocationNumber(e); break; case AvailabilityCode.refname: case AvailabilityCode.shortname: availabilityCode = new AvailabilityCode(e); break; case SupplyToCountry.refname: case SupplyToCountry.shortname: supplyToCountrys = JPU.addToList(supplyToCountrys, new SupplyToCountry(e)); break; case SupplierSAN.refname: case SupplierSAN.shortname: supplierSAN = new SupplierSAN(e); break; case SupplierName.refname: case SupplierName.shortname: supplierName = new SupplierName(e); break; case SupplierRole.refname: case SupplierRole.shortname: supplierRole = new SupplierRole(e); break; case SupplyToTerritory.refname: case SupplyToTerritory.shortname: supplyToTerritory = new SupplyToTerritory(e); break; case SupplyRestrictionDetail.refname: case SupplyRestrictionDetail.shortname: supplyRestrictionDetail = new SupplyRestrictionDetail(e); break; case ReturnsCodeType.refname: case ReturnsCodeType.shortname: returnsCodeType = new ReturnsCodeType(e); break; case ReturnsCode.refname: case ReturnsCode.shortname: returnsCode = new ReturnsCode(e); break; case LastDateForReturns.refname: case LastDateForReturns.shortname: lastDateForReturns = new LastDateForReturns(e); break; case ProductAvailability.refname: case ProductAvailability.shortname: productAvailability = new ProductAvailability(e); break; case IntermediaryAvailabilityCode.refname: case IntermediaryAvailabilityCode.shortname: intermediaryAvailabilityCode = new IntermediaryAvailabilityCode(e); break; case NewSupplier.refname: case NewSupplier.shortname: newSupplier = new NewSupplier(e); break; case DateFormat.refname: case DateFormat.shortname: dateFormat = new DateFormat(e); break; case ExpectedShipDate.refname: case ExpectedShipDate.shortname: expectedShipDate = new ExpectedShipDate(e); break; case OnSaleDate.refname: case OnSaleDate.shortname: onSaleDate = new OnSaleDate(e); break; case OrderTime.refname: case OrderTime.shortname: orderTime = new OrderTime(e); break; case PackQuantity.refname: case PackQuantity.shortname: packQuantity = new PackQuantity(e); break; case AudienceRestrictionFlag.refname: case AudienceRestrictionFlag.shortname: audienceRestrictionFlag = new AudienceRestrictionFlag(e); break; case AudienceRestrictionNote.refname: case AudienceRestrictionNote.shortname: audienceRestrictionNote = new AudienceRestrictionNote(e); break; case PriceAmount.refname: case PriceAmount.shortname: priceAmount = new PriceAmount(e); break; case UnpricedItemType.refname: case UnpricedItemType.shortname: unpricedItemType = new UnpricedItemType(e); break; case Reissue.refname: case Reissue.shortname: reissue = new Reissue(e); break; case SupplierIdentifier.refname: case SupplierIdentifier.shortname: supplierIdentifiers = JPU.addToList(supplierIdentifiers, new SupplierIdentifier(e)); break; case TelephoneNumber.refname: case TelephoneNumber.shortname: telephoneNumbers = JPU.addToList(telephoneNumbers, new TelephoneNumber(e)); break; case FaxNumber.refname: case FaxNumber.shortname: faxNumbers = JPU.addToList(faxNumbers, new FaxNumber(e)); break; case EmailAddress.refname: case EmailAddress.shortname: emailAddresss = JPU.addToList(emailAddresss, new EmailAddress(e)); break; case Website.refname: case Website.shortname: websites = JPU.addToList(websites, new Website(e)); break; case SupplyToRegion.refname: case SupplyToRegion.shortname: supplyToRegions = JPU.addToList(supplyToRegions, new SupplyToRegion(e)); break; case SupplyToCountryExcluded.refname: case SupplyToCountryExcluded.shortname: supplyToCountryExcludeds = JPU.addToList(supplyToCountryExcludeds, new SupplyToCountryExcluded(e)); break; case Stock.refname: case Stock.shortname: stocks = JPU.addToList(stocks, new Stock(e)); break; case Price.refname: case Price.shortname: prices = JPU.addToList(prices, new Price(e)); break; default: break; } }); } /** * @return whether this tag (<SupplyDetail> or <supplydetail>) is explicitly provided in the ONIX XML */ @Override public boolean exists() { return exists; } public void ifExists(Consumer action) { if (exists) { action.accept(this); } } @Override public org.w3c.dom.Element getXmlElement() { return element; } ///////////////////////////////////////////////////////////////////////////////// // MEMBERS ///////////////////////////////////////////////////////////////////////////////// private SupplierEANLocationNumber supplierEANLocationNumber = SupplierEANLocationNumber.EMPTY; /** *

* An EAN-13 location number identifying a supply source from which the product may be ordered by a trade customer. * Now also known as an “EAN-UCC Global Location Number” or GLN. Optional, but each occurrence of the * <SupplyDetail> composite must carry either at least one supplier identifier, or a <SupplierName>. *

* Jonix-Comment: this field is required */ public SupplierEANLocationNumber supplierEANLocationNumber() { _initialize(); return supplierEANLocationNumber; } private AvailabilityCode availabilityCode = AvailabilityCode.EMPTY; /** *

* An ONIX code indicating the availability of a product. Each occurrence of the <SupplyDetail> composite must * carry either <AvailabilityCode> or <ProductAvailability>, or both, but <ProductAvailability> is * now strongly preferred. Non-repeating. *

*

* Some code values require other accompanying data. Where the code lists state that one of the following is * required or may optionally be sent, use the element indicated below: *

*
    *
  • Expected availability date – use <ExpectedShipDate>
  • *
  • Remainder date – <ExpectedShipDate> is again used
  • *
  • Estimated time to supply – <OrderTime>
  • *
  • Identifier of alternative or successor product – <RelatedProduct>, Group PR.23
  • *
  • New supplier – <NewSupplier>
  • *
* Jonix-Comment: this field is required */ public AvailabilityCode availabilityCode() { _initialize(); return availabilityCode; } private ListOfOnixElement> supplyToCountrys = ListOfOnixElement.empty(); /** *

* One or more ISO standard codes identifying a country for which the supplier holds distribution rights for the * product. Successive codes may be separated by spaces. Thus, a single occurrence of the element can carry an * unlimited number of country codes. For upwards compatibility, the element remains repeatable, so that multiple * countries can be listed as multiple occurrences of the whole element. Optional and repeatable. *

* Jonix-Comment: this list is required to contain at least one item */ public ListOfOnixElement> supplyToCountrys() { _initialize(); return supplyToCountrys; } private SupplierSAN supplierSAN = SupplierSAN.EMPTY; /** *

* The book trade Standard Address Number that identifies the supplier with whom trade orders for the product should * be placed. Used in the US and UK. Optional, but each occurrence of the <SupplyDetail> composite must carry * either at least one supplier identifier, or a <SupplierName>. *

* Jonix-Comment: this field is optional */ public SupplierSAN supplierSAN() { _initialize(); return supplierSAN; } private SupplierName supplierName = SupplierName.EMPTY; /** *

* The name of a supply source from which the product may be ordered by a trade customer. Optional and * non-repeating; required if no supplier identifier is sent. *

* Jonix-Comment: this field is optional */ public SupplierName supplierName() { _initialize(); return supplierName; } private SupplierRole supplierRole = SupplierRole.EMPTY; /** *

* An ONIX code identifying the role of a supplier in relation to the product, eg Publisher, Publisher’s * exclusive distributor, etc. Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public SupplierRole supplierRole() { _initialize(); return supplierRole; } private SupplyToTerritory supplyToTerritory = SupplyToTerritory.EMPTY; /** *

* One or more ONIX codes identifying a territory which is not a country, but which is precisely defined in * geographical terms, eg World, Northern Ireland, Australian Capital Territory. Successive codes may be * separated by spaces. Thus the element can carry an unlimited number of territory codes, for territories for which * the supplier has distribution rights. Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public SupplyToTerritory supplyToTerritory() { _initialize(); return supplyToTerritory; } private SupplyRestrictionDetail supplyRestrictionDetail = SupplyRestrictionDetail.EMPTY; /** *

* A free text field describing a non-geographical restriction of the market covered by a distributor or other * supplier. Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public SupplyRestrictionDetail supplyRestrictionDetail() { _initialize(); return supplyRestrictionDetail; } private ReturnsCodeType returnsCodeType = ReturnsCodeType.EMPTY; /** *

* An ONIX code identifying the scheme from which the returns conditions code in <ReturnsCode> is taken. * Optional and non-repeating, but this field must be present if <ReturnsCode> is present. *

* Jonix-Comment: this field is optional */ public ReturnsCodeType returnsCodeType() { _initialize(); return returnsCodeType; } private ReturnsCode returnsCode = ReturnsCode.EMPTY; /** *

* A returns conditions code from the scheme specified in <ReturnsCodeType>. Optional and non-repeating, but * this field must be present if <ReturnsCodeType> is present. *

* Jonix-Comment: this field is optional */ public ReturnsCode returnsCode() { _initialize(); return returnsCode; } private LastDateForReturns lastDateForReturns = LastDateForReturns.EMPTY; /** *

* The last date for returns, when the supplier has placed a time limit on returns from retailers. Typically this * occurs when the publisher has made the product out-of-print. Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public LastDateForReturns lastDateForReturns() { _initialize(); return lastDateForReturns; } private ProductAvailability productAvailability = ProductAvailability.EMPTY; /** *

* An ONIX code indicating the availability of a product from a supplier. This element has been added as a preferred * successor to the <AvailabilityCode> element, and is intended to be used both by publishers (who should also * include the new <PublishingStatus> element in PR.20) and by intermediary suppliers (who may also include * <PublishingStatus> if they are in a position to do so. Each occurrence of the <SupplyDetail> * composite must carry either <AvailabilityCode> or <ProductAvailability>, or both. The element is * non-repeating. Recommended practise is in future to use this new element, and, where possible and appropriate, to * include the <PublishingStatus> element in PR.20. It is likely that the <AvailabilityCode> element * will be “deprecated” in due course in a future release. *

* Jonix-Comment: this field is optional */ public ProductAvailability productAvailability() { _initialize(); return productAvailability; } private IntermediaryAvailabilityCode intermediaryAvailabilityCode = IntermediaryAvailabilityCode.EMPTY; /** *

* An ONIX code indicating the availability of a product from an intermediary supplier. This element was added in * preparation for an expected revision of availability status coding, but in the event will not now be generally * used. The element is being used as an interim measure by the Australian ONIX group to carry local availability * status, but will be replaced on completion of the revised code lists. The element will be withdrawn from the ONIX * format in a future release. *

* Jonix-Comment: this field is optional */ public IntermediaryAvailabilityCode intermediaryAvailabilityCode() { _initialize(); return intermediaryAvailabilityCode; } private NewSupplier newSupplier = NewSupplier.EMPTY; /** *

* A group of data elements which together specify a new supply source to which orders are referred. Use only when * the code in <ProductAvailability> or <AvailabilityCode> indicates “no longer available from us, refer * to new supplier”. Only one occurrence of the composite is permitted in this context. *

* Jonix-Comment: this field is optional */ public NewSupplier newSupplier() { _initialize(); return newSupplier; } private DateFormat dateFormat = DateFormat.EMPTY; /** *

* An ONIX code which specifies the format of the date in <ExpectedShipDate>. Optional an non-repeating. If * the field is omitted, the default format YYYYMMDD will be assumed. *

* Jonix-Comment: this field is optional */ public DateFormat dateFormat() { _initialize(); return dateFormat; } private ExpectedShipDate expectedShipDate = ExpectedShipDate.EMPTY; /** *

* If the product is not currently available, the date on which shipping from the supplier to retailers is expected * to begin or resume. Optional and non-repeating; required with certain code values in the <AvailabilityCode> * element. The format is as specified in the <DateFormat> field. The default format is YYYYMMDD, ie * an exact year-month-day. *

* Jonix-Comment: this field is optional */ public ExpectedShipDate expectedShipDate() { _initialize(); return expectedShipDate; } private OnSaleDate onSaleDate = OnSaleDate.EMPTY; /** *

* The date when a new product can be placed on sale by retailers in the market served by the supplier. Optional and * non-repeating. If the <OnSaleDate> element is used, it means that there is an embargo on sales to * consumers before the stated date. Otherwise, sales to consumers are permitted as soon as stocks reach * retailers. In the UK, publishers who are following the PA/BA Launch Dates Code of Practice should use * this element for the Launch Date. *

* Jonix-Comment: this field is optional */ public OnSaleDate onSaleDate() { _initialize(); return onSaleDate; } private OrderTime orderTime = OrderTime.EMPTY; /** *

* The expected average number of days from receipt of order to despatch (for items “manufactured on demand” or * “only to order”). Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public OrderTime orderTime() { _initialize(); return orderTime; } private PackQuantity packQuantity = PackQuantity.EMPTY; /** *

* The quantity in each carton or binder’s pack in stock currently held by the supplier. (This element is placed in * Group PR.24 since it cannot be assumed that pack quantities will be the same for stock held at different * suppliers.) *

* Jonix-Comment: this field is optional */ public PackQuantity packQuantity() { _initialize(); return packQuantity; } private AudienceRestrictionFlag audienceRestrictionFlag = AudienceRestrictionFlag.EMPTY; /** *

* Used with <AudienceRestrictionNote> where within a particular market there is an additional restriction on * sale, imposed either by the publisher (eg an answer book to be sold only to bona fide teachers) or by * another agency (eg “indexing” in the German market). Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public AudienceRestrictionFlag audienceRestrictionFlag() { _initialize(); return audienceRestrictionFlag; } private AudienceRestrictionNote audienceRestrictionNote = AudienceRestrictionNote.EMPTY; /** *

* Free text describing a non-territorial restriction on supply, only when <AudienceRestrictionFlag> is * present. Optional and non-repeating. *

* Jonix-Comment: this field is optional */ public AudienceRestrictionNote audienceRestrictionNote() { _initialize(); return audienceRestrictionNote; } private PriceAmount priceAmount = PriceAmount.EMPTY; /** *

* The amount of a unit price. This price amount element, outside of the <Price> composite, may be used if and * only if a default price type and currency have been specified in the message header, and only one price is to be * given. The element is retained for purposes of upwards compatibility only, and all new implementations * should use the <Price> composite. *

* Jonix-Comment: this field is optional */ public PriceAmount priceAmount() { _initialize(); return priceAmount; } private UnpricedItemType unpricedItemType = UnpricedItemType.EMPTY; /** *

* An ONIX code which specifies a reason why a price amount is not sent. If code value 02 is used to send * advance information without giving a price, the price must be confirmed as soon as possible. Optional * and non-repeating, but required if the <SupplyDetail> composite does not carry a price. *

* Jonix-Comment: this field is optional */ public UnpricedItemType unpricedItemType() { _initialize(); return unpricedItemType; } private Reissue reissue = Reissue.EMPTY; /** *

* A group of data elements which together specify that a product is to be reissued within the market to which the * <SupplyDetail> composite applies. Optional and non-repeating. The <Reissue> composite is used only * when the publisher intends to re-launch the product under the same ISBN. There are two possible cases: *

*
    *
  1. When the product is unavailable during the period immediately before reissue. In this case, the * <AvailabilityCode> should carry the value UR for “unavailable, awaiting reissue”, and the ONIX record can * be updated to describe the reissued product as soon as details can be made available
  2. *
  3. When the product is still available during the period up to the reissue date. In this case, the ONIX record * should continue to describe the existing product and the <AvailabilityCode> value should remain IP right up * to the reissue date. At that date, the record should be updated to describe the reissued product, with the * <AvailabilityCode> value remaining IP.
  4. *
*

* After reissue, it is recommended that the <Reissue> composite should be retained as a permanent element of * the ONIX record, carrying only the <ReissueDate> element, which will then indicate “date last reissued”. *

* Jonix-Comment: this field is optional */ public Reissue reissue() { _initialize(); return reissue; } private ListOfOnixDataCompositeWithKey supplierIdentifiers = JPU.emptyListOfOnixDataCompositeWithKey(SupplierIdentifier.class); /** *

* A repeatable group of data elements which together define the identifier of a supplier in accordance with a * specified scheme, and allowing different types of supplier identifier to be included without defining additional * data elements. Optional, but each occurrence of the <SupplyDetail> composite must carry either at least one * supplier identifier, or a <SupplierName>. *

* Jonix-Comment: this list may be empty */ public ListOfOnixDataCompositeWithKey supplierIdentifiers() { _initialize(); return supplierIdentifiers; } private ListOfOnixElement telephoneNumbers = ListOfOnixElement.empty(); /** *

* A telephone number of a supply source from which the product may be ordered by a trade customer. Optional and * repeatable. *

* Jonix-Comment: this list may be empty */ public ListOfOnixElement telephoneNumbers() { _initialize(); return telephoneNumbers; } private ListOfOnixElement faxNumbers = ListOfOnixElement.empty(); /** *

* A fax number of a supply source from which the product may be ordered by a trade customer. Optional and * repeatable. *

* Jonix-Comment: this list may be empty */ public ListOfOnixElement faxNumbers() { _initialize(); return faxNumbers; } private ListOfOnixElement emailAddresss = ListOfOnixElement.empty(); /** *

* An email address for a supply source from which the product may be ordered by a trade customer. Optional and * repeatable. *

* Jonix-Comment: this list may be empty */ public ListOfOnixElement emailAddresss() { _initialize(); return emailAddresss; } private ListOfOnixDataComposite websites = JPU.emptyListOfOnixDataComposite(Website.class); /** *

* An optional and repeatable group of data elements which together identify and provide pointers to a website which * is related to the supplier identified in an occurrence of the <SupplyDetail> composite. *

* Jonix-Comment: this list may be empty */ public ListOfOnixDataComposite websites() { _initialize(); return websites; } private ListOfOnixCodelist supplyToRegions = ListOfOnixCodelist.emptyList(); /** *

* An ONIX code for a region to which the supplier is able to supply. A full code list is yet to be defined. A * provisional coding, for UK use only, is given for Open Market supply. This element will not be further * developed, and is superseded by <SupplyToTerritory> above. It is retained for purposes of upwards * compatibility only. Note that Open Market distribution rights should be specified, like any others, by listing * countries and territories. *

* Jonix-Comment: this list may be empty */ public ListOfOnixCodelist supplyToRegions() { _initialize(); return supplyToRegions; } private ListOfOnixElement> supplyToCountryExcludeds = ListOfOnixElement.empty(); /** *

* One or more ISO standard codes identifying a country which is excluded from a territory specified in * <SupplyToTerritory>. Successive codes may be separated by spaces. Thus, a single occurrence of the element * can carry an unlimited number of country codes. For upwards compatibility, the element remains repeatable, so * that multiple countries can be listed as multiple occurrences of the whole element. Optional and repeatable. *

* Jonix-Comment: this list may be empty */ public ListOfOnixElement> supplyToCountryExcludeds() { _initialize(); return supplyToCountryExcludeds; } private ListOfOnixComposite stocks = JPU.emptyListOfOnixComposite(Stock.class); /** *

* A repeatable group of data elements which together specify a quantity of stock and, where a supplier has more * than one warehouse, a supplier location. Optional. *

* Jonix-Comment: this list may be empty */ public ListOfOnixComposite stocks() { _initialize(); return stocks; } private ListOfOnixComposite prices = JPU.emptyListOfOnixComposite(Price.class); /** *

* A repeatable group of data elements which together specify a unit price. *

* Jonix-Comment: this list may be empty */ public ListOfOnixComposite prices() { _initialize(); return prices; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy