Module jonix.onix3

Class DiscountCoded

java.lang.Object
com.tectonica.jonix.onix3.DiscountCoded
All Implemented Interfaces:
OnixComposite, OnixComposite.OnixDataComposite<JonixDiscountCoded>, OnixComposite.OnixDataCompositeWithKey<JonixDiscountCoded,DiscountCodeTypes>, OnixTag, Serializable

Discount code composite

An optional group of data elements which together define a discount code from a specified scheme, and repeatable to allow different discount code schemes to be supported without defining additional data elements. For prices specified as Agency prices in <PriceType>, this code is interpreted as a ‘commission code’.

A discount code is generally used when the exact percentage discount (or commission, in an agency business model) that a code represents may vary from reseller to reseller (or from agent to agent), or if terms must be kept confidential. If the discount (or commission) is the same for all resellers (or agents) and need not be kept confidential, use <Discount> and <DiscountPercent> instead.

Reference name <DiscountCoded>
Short tag <discountcoded>
Cardinality 0…n

This tag may be included in the following composites:

Possible placements within ONIX message:

See Also:
  • Field Details

  • Constructor Details

    • DiscountCoded

      public DiscountCoded()
    • DiscountCoded

      public DiscountCoded(Element element)
  • Method Details

    • _initialize

      public void _initialize()
      Description copied from interface: OnixComposite
      This is an internal API. Since Jonix 8.0, composite objects are being populated lazily. This method initiates the population process, and is invoked internally by the accessor APIs of the composites
      Specified by:
      _initialize in interface OnixComposite
    • exists

      public boolean exists()
      Description copied from interface: OnixTag
      indicates whether this tag exists in the ONIX record
      Specified by:
      exists in interface OnixTag
      Returns:
      whether this tag (<DiscountCoded> or <discountcoded>) is explicitly provided in the ONIX XML
    • ifExists

      public void ifExists(Consumer<DiscountCoded> action)
    • getXmlElement

      public Element getXmlElement()
      Description copied from interface: OnixComposite
      For advanced use-cases only.
      Specified by:
      getXmlElement in interface OnixComposite
      Returns:
      native representation of the XML element underlying to this tag
    • discountCodeType

      public DiscountCodeType discountCodeType()

      An ONIX code identifying the scheme from which the value in the <DiscountCode> element is taken. Mandatory in each occurrence of the <DiscountCoded> composite, and non-repeating.

      Jonix-Comment: this field is required
    • discountCode

      public DiscountCode discountCode()

      A discount or commission code from the scheme specified in the <DiscountCodeType> element. Mandatory in each occurrence of the <DiscountCoded> composite, and non-repeating.

      Jonix-Comment: this field is required
    • discountCodeTypeName

      public DiscountCodeTypeName discountCodeTypeName()

      A name which identifies a proprietary discount code. Must be used when, and only when the code in the <DiscountCodeType> element indicates a proprietary scheme, eg a wholesaler’s own code. Optional and non-repeating.

      Jonix-Comment: this field is optional
    • asStruct

      public JonixDiscountCoded asStruct()
      Specified by:
      asStruct in interface OnixComposite.OnixDataComposite<JonixDiscountCoded>
    • structKey

      public DiscountCodeTypes structKey()
      Specified by:
      structKey in interface OnixComposite.OnixDataCompositeWithKey<JonixDiscountCoded,DiscountCodeTypes>