ComplexBarcode.js

const generation = require("./Generation");
const joint = require('./Joint');

const java = require('java');


/**
 * Interface for complex codetext used with ComplexBarcodeGenerator.
 */
class IComplexCodetext extends joint.BaseJavaClass
{
    constructor(javaClass)
    {
        super(javaClass);
        this.init();
    }

    /**
     * Construct codetext for complex barcode
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        throw new BarcodeException('You have to implement the method getConstructedCodetext!');
    }

    /**
     * Initializes instance with constructed codetext.
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        throw new BarcodeException('You have to implement the method initFromString!');
    }

    /**
     * Gets barcode type.
     * @return Barcode type.
     */
    getBarcodeType()
    {
        throw new BarcodeException('You have to implement the method getBarcodeType!');
    }
}

/**
 *  ComplexBarcodeGenerator for backend complex barcode (e.g. SwissQR) images generation.
 *  @example
 *  This sample shows how to create and save a SwissQR image.
 *    let swissQRCodetext = new SwissQRCodetext(null);
 *    swissQRCodetext.getBill().setAccount("Account");
 *    swissQRCodetext.getBill().setBillInformation("BillInformation");
 *    swissQRCodetext.getBill().setBillInformation("BillInformation");
 *    swissQRCodetext.getBill().setAmount(1024);
 *    swissQRCodetext.getBill().getCreditor().setName("Creditor.Name");
 *    swissQRCodetext.getBill().getCreditor().setAddressLine1("Creditor.AddressLine1");
 *    swissQRCodetext.getBill().getCreditor().setAddressLine2("Creditor.AddressLine2");
 *    swissQRCodetext.getBill().getCreditor().setCountryCode("Nl");
 *    swissQRCodetext.getBill().setUnstructuredMessage("UnstructuredMessage");
 *    swissQRCodetext.getBill().setReference("Reference");
 *    swissQRCodetext.getBill().setAlternativeSchemes([new AlternativeScheme("AlternativeSchemeInstruction1"),new AlternativeScheme("AlternativeSchemeInstruction2")]);
 *    swissQRCodetext.getBill().setDebtor(new Address(null));
 *    swissQRCodetext.getBill().getDebtor().setName("Debtor.Name");
 *    swissQRCodetext.getBill().getDebtor().setAddressLine1("Debtor.AddressLine1");
 *    swissQRCodetext.getBill().getDebtor().setAddressLine2("Debtor.AddressLine2");
 *    swissQRCodetext.getBill().getDebtor().setCountryCode("Lux");
 *    let cg = new ComplexBarcodeGenerator(swissQRCodetext);
 *    let res = cg.generateBarCodeImage(BarcodeImageFormat.PNG);
 */
class ComplexBarcodeGenerator extends joint.BaseJavaClass {
    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwComplexBarcodeGenerator";
    parameters;

    init() {
        this.parameters = new generation.BaseGenerationParameters(this.getJavaClass().getParametersSync());
    }

    /**
     * Generation parameters.
     */
    getParameters() {
        return this.parameters;
    }

    /**
     * Creates an instance of ComplexBarcodeGenerator.
     * @param complexCodetext Complex codetext
     */
    constructor(complexCodetext)
    {
        let java_class_link = java.import(ComplexBarcodeGenerator.javaClassName);
        super(new java_class_link(complexCodetext.getJavaClass()));
        this.init();
    }

    /**
     * Generates complex barcode image under current settings.
     * @return  Base64 presentation of image.
     */
    generateBarCodeImage(format) {
        let base64Image = this.getJavaClass().generateBarCodeImageSync(format);
        return base64Image;
    }

    /**
     * <p>
     * Generates and saves complex barcode image under current settings.
     * </p>
     * @param filePath Path to save to.
     * @param format BarCodeImageFormat(PNG, BMP, JPEG, GIF)
     */
    save(filePath, format) {
        let image64 = this.generateBarcodeImage(format);
        let buff = Buffer.from(image64, 'base64');
        fs.writeFileSync(filePath, buff);
    }
}

/**
 * Address of creditor or debtor.<br>
 * <br>
 * You can either set street, house number, postal code and town (type structured address)<br>
 * or address line 1 and 2 (type combined address elements). The type is automatically set<br>
 * once any of these fields is set. Before setting the fields, the address type is undetermined.<br>
 * If fields of both types are set, the address type becomes conflicting.<br>
 * Name and country code must always be set unless all fields are empty.<br>
 */
class Address extends joint.BaseJavaClass {
    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwAddress";

    constructor()
    {
        let javaClass = java.import(Address.javaClassName)
        super(new javaClass());
        this.init();
    }

    static construct(javaClass)
    {
        let address = new Address();
        address.setJavaClass(javaClass);
        address.init();
        return address;
    }

    /**
     * Gets the address type.<br>
     * <br>
     * The address type is automatically set by either setting street / house number<br>
     * or address line 1 and 2. Before setting the fields, the address type is Undetermined.<br>
     * If fields of both types are set, the address type becomes Conflicting.<br>
     * @return The address type.
     */
    getType() {
        return this.getJavaClass().getTypeSync();
    }

    /**
     * Gets the name, either the first and last name of a natural person or the<br>
     * company name of a legal person.<br>
     * @return The name.
     */
    getName() {
        return this.getJavaClass().getNameSync();
    }

    /**
     * Sets the name, either the first and last name of a natural person or the<br>
     * company name of a legal person.<br>
     * @param value: The name.
     */
    setName(value) {
        this.getJavaClass().setNameSync(value);
    }

    /**
     * Gets the address line 1.<br>
     * <br>
     * Address line 1 contains street name, house number or P.O. box.<br>
     * <br>
     * Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already<br>
     * AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for combined elements addresses and is optional.<br>
     * <br>
     * @return The address line 1.
     */
    getAddressLine1() {
        return this.getJavaClass().getAddressLine1Sync();
    }

    /**
     * Sets the address line 1.<br>
     * <br>
     * Address line 1 contains street name, house number or P.O. box.<br>
     * <br>
     * Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already<br>
     * AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for combined elements addresses and is optional.<br>
     * <br>
     * @param value: The address line 1.<br>
     */
    setAddressLine1(value) {
        this.getJavaClass().setAddressLine1Sync(value);
    }

    /**
     * Gets the address line 2.<br>
     * Address line 2 contains postal code and town.<br>
     * Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already<br>
     * AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.<br>
     * This field is only used for combined elements addresses. For this type, it's mandatory.<br>
     * @return The address line 2.
     */
    getAddressLine2() {
        return this.getJavaClass().getAddressLine2Sync();
    }

    /**
     * Sets the address line 2.<br>
     * Address line 2 contains postal code and town.<br>
     * Setting this field sets the address type to AddressType.COMBINED_ELEMENTS unless it's already<br>
     * AddressType.STRUCTURED, in which case it becomes AddressType.CONFLICTING.<br>
     * This field is only used for combined elements addresses. For this type, it's mandatory.<br>
     * @param value: The address line 2.
     */
    setAddressLine2(value) {
        this.getJavaClass().setAddressLine2Sync(value);
    }

    /**
     * Gets the street.<br>
     * The street must be speicfied without house number.<br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * This field is only used for structured addresses and is optional.<br>
     * @return The street.
     */
    getStreet() {
        return this.getJavaClass().getStreetSync();
    }

    /**
     * Sets the street.<br>
     * <br>
     * The street must be speicfied without house number.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses and is optional.<br>
     * <br>
     * @param value: The street.
     */
    setStreet(value) {
        this.getJavaClass().setStreetSync(value);
    }

    /**
     * Gets the house number.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses and is optional.<br>
     * <br>
     * @return The house number.<br>
     */
    getHouseNo() {
        return this.getJavaClass().getHouseNoSync();
    }

    /**
     * Sets the house number.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses and is optional.<br>
     * <br>
     * @param value: The house number.
     */
    setHouseNo(value) {
        this.getJavaClass().setHouseNoSync(value);
    }

    /**
     * Gets the postal code.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses. For this type, it's mandatory.<br>
     * <br>
     * @return The postal code.
     */
    getPostalCode() {
        return this.getJavaClass().getPostalCodeSync();
    }

    /**
     * Sets the postal code.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses. For this type, it's mandatory.<br>
     * <br>
     * @param value The postal code.
     */
    setPostalCode(value) {
        this.getJavaClass().setPostalCodeSync(value);
    }

    /**
     * Gets the town or  city.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses. For this type, it's mandatory.<br>
     * <br>
     * @return The town or city.
     */
    getTown() {
        return this.getJavaClass().getTownSync();
    }

    /**
     * Sets the town or city.<br>
     * <br>
     * Setting this field sets the address type to AddressType.STRUCTURED unless it's already<br>
     * AddressType.COMBINED_ELEMENTS, in which case it becomes AddressType.CONFLICTING.<br>
     * <br>
     * This field is only used for structured addresses. For this type, it's mandatory.<br>
     * <br>
     * @param value The town or city.
     */
    setTown(value) {
        this.getJavaClass().setTownSync(value);
    }

    /**
     * Gets the two-letter ISO country code.<br>
     * <br>
     * The country code is mandatory unless the entire address contains null or emtpy values. <br>
     * <br>
     * @return The ISO country code.<br>
     */
    getCountryCode() {
        return this.getJavaClass().getCountryCodeSync();
    }

    /**
     * Sets the two-letter ISO country code. <br>
     * <br>
     * The country code is mandatory unless the entire address contains null or emtpy values.<br>
     * <br>
     * @param value The ISO country code.<br>
     */
    setCountryCode(value) {
        this.getJavaClass().setCountryCodeSync(value);
    }

    /**
     * Clears all fields and sets the type to AddressType.UNDETERMINED.
     */
    clear() {
        this.setName(null);
        this.setAddressLine1(null);
        this.setaddressLine2(null);
        this.setStreet(null);
        this.setHouseNo(null);
        this.setPostalCode(null);
        this.setTown(null);
        this.setCountryCode(null);
    }

    /**
     * Determines whether the specified object is equal to the current object.<br>
     * @return true if the specified object is equal to the current object; otherwise, false.<br>
     * @param obj The object to compare with the current object.<br>
     */
    equals(obj) {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Gets the hash code for this instance.<br>
     * @return A hash code for the current object<br>.
     */
    hashCode() {
        return this.getJavaClass().hashCodeSync();
    }

    init() {

    }
}

/**
 * Address type
 * @enum
 */
AddressType =
    {
        /**
         * Undetermined
         */
        UNDETERMINED: "0",
        /**
         * Structured address
         */
        STRUCTURED: "1",
        /**
         * Combined address elements
         */
        COMBINED_ELEMENTS: "2",
        /**
         * Conflicting
         */
        CONFLICTING: "3"
    };

/**
 * Alternative payment scheme instructions
 */
class AlternativeScheme extends joint.BaseJavaClass {
    static get javaClassName() {
        return "com.aspose.mw.barcode.complexbarcode.MwAlternativeScheme";
    }

    constructor(instruction)
    {
        let javaAlternativeScheme = java.import(AlternativeScheme.javaClassName);
        super(new javaAlternativeScheme(instruction));
    }

    static construct(javaClass)
    {
        let jsClass = new AlternativeScheme("");
        jsClass.setJavaClass(javaClass);
        return jsClass;
    }

    /**
     * Gets the payment instruction for a given bill.<br>
     * <br>
     * The instruction consists of a two letter abbreviation for the scheme, a separator characters<br>
     * and a sequence of parameters(separated by the character at index 2).<br>
     */
    getInstruction() {
        return this.getJavaClass().getInstructionSync();
    }

    /**
     * Gets the payment instruction for a given bill.<br>
     * The instruction consists of a two letter abbreviation for the scheme, a separator characters<br>
     * and a sequence of parameters(separated by the character at index 2).
     */
    setInstruction(value) {
        this.getJavaClass().setInstructionSync(value);
    }

    /**
     * Determines whether the specified object is equal to the current object.<br>
     * @return true if the specified object is equal to the current object; otherwise, false.<br>
     * @param obj The object to compare with the current object.
     */
    equals(obj) {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Gets the hash code for this instance.<br>
     * @return  hash code for the current object.
     */
    hashCode() {
        return this.getJavaClass().hashCodeSync();
    }

    init() {

    }
}

/**
 *  ComplexCodetextReader decodes codetext to specified complex barcode type.<br>
 *  @example
 *  This sample shows how to recognize and decode SwissQR image.
 *
 *  let cr = new BarCodeReader("SwissQRCodetext.png", null, DecodeType.QR);
 *  cr.read();
 *  let result = ComplexCodetextReader.tryDecodeSwissQR(cr.getCodeText(false));
 */
class ComplexCodetextReader {
    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwComplexCodetextReader";

    /**
     * Decodes SwissQR codetext.
     *
     * @param encodedCodetext encoded codetext
     * @return decoded SwissQRCodetext or null.
     */
    static tryDecodeSwissQR(encodedCodetext) {
        let javaJsComplexCodetextReader = java.import(ComplexCodetextReader.javaClassName);
        return SwissQRCodetext.construct(javaJsComplexCodetextReader.tryDecodeSwissQRSync(encodedCodetext));
    }

    /**
     * Decodes Royal Mail Mailmark 2D codetext.<br>
     * @param encodedCodetext encoded codetext<br>
     * @return decoded Royal Mail Mailmark 2D or null.
     */
    static tryDecodeMailmark2D(encodedCodetext)
    {
        let javaJsComplexCodetextReader = java.import(ComplexCodetextReader.javaClassName);
        return Mailmark2DCodetext.construct(javaJsComplexCodetextReader.tryDecodeMailmark2DSync(encodedCodetext));
    }

    /**
     * Decodes Mailmark Barcode C and L codetext.<br>
     * @param encodedCodetext encoded codetext<br>
     * @return Decoded Mailmark Barcode C and L or null.
     */
    static tryDecodeMailmark(encodedCodetext)
    {
        let res = new MailmarkCodetext(null);
        try
        {
            res.initFromString(encodedCodetext);
        }
        catch (e)
        {
            return null;
        }
        return res;
    }

    /**
     * Decodes MaxiCode codetext.
     * @param maxiCodeMode MaxiCode mode
     * @param encodedCodetext encoded codetext
     * @return Decoded MaxiCode codetext.
     */
    static tryDecodeMaxiCode(maxiCodeMode, encodedCodetext)
    {
        let javaComplexCodetextReaderClass = java.import(ComplexCodetextReader.javaClassName);
        let javaMaxiCodeCodetextMode2Class = java.import(MaxiCodeCodetextMode2.JAVA_CLASS_NAME);
        let javaMaxiCodeCodetextMode3Class = java.import(MaxiCodeCodetextMode3.JAVA_CLASS_NAME);
        let javaMaxiCodeCodetext =  javaComplexCodetextReaderClass.tryDecodeMaxiCodeSync(maxiCodeMode, encodedCodetext);

        if(javaMaxiCodeCodetext.getClassSync().equalsSync(javaMaxiCodeCodetextMode2Class.class))
        {
            return MaxiCodeCodetextMode2.construct(javaMaxiCodeCodetext);
        }
        else if(javaMaxiCodeCodetext.getClassSync().equalsSync(javaMaxiCodeCodetextMode3Class.class))
        {
            return MaxiCodeCodetextMode3.construct(javaMaxiCodeCodetext);
        }
        else
        {
            return MaxiCodeStandardCodetext.construct(javaMaxiCodeCodetext);
        }
    }

    /**
     * <p>
     * Decodes HIBC LIC codetext.
     * </p>
     * @return decoded HIBC LIC Complex Codetext or null.
     * @param encodedCodetext encoded codetext
     */
    static tryDecodeHIBCLIC(encodedCodetext)
    {
        let javaHIBCLICSecondaryAndAdditionalDataCodetextClass = java.import(HIBCLICSecondaryAndAdditionalDataCodetext.JAVA_CLASS_NAME);
        let javaHIBCLICPrimaryDataCodetextClass = java.import(HIBCLICPrimaryDataCodetext.JAVA_CLASS_NAME);
        let javaHIBCLICCombinedCodetextClass = java.import(HIBCLICCombinedCodetext.JAVA_CLASS_NAME);
        let javaNodeJsComplexCodetextReaderJavaClass = java.import(ComplexCodetextReader.javaClassName);
        let hibclicComplexCodetext = javaNodeJsComplexCodetextReaderJavaClass.tryDecodeHIBCLICSync(encodedCodetext);
        if(hibclicComplexCodetext == null)
            return null;
        if(hibclicComplexCodetext.getClassSync().equalsSync(javaHIBCLICSecondaryAndAdditionalDataCodetextClass.class))
        {
            return HIBCLICSecondaryAndAdditionalDataCodetext.construct(hibclicComplexCodetext);
        }
        else if(hibclicComplexCodetext.getClassSync().equalsSync(javaHIBCLICPrimaryDataCodetextClass.class))
        {
            return HIBCLICPrimaryDataCodetext.construct(hibclicComplexCodetext);
        }
        else if(hibclicComplexCodetext.getClassSync().equalsSync(javaHIBCLICCombinedCodetextClass.class))
        {
            return HIBCLICCombinedCodetext.construct(hibclicComplexCodetext);
        }
        return null;
    }

    /**
     * <p>
     * Decodes HIBC PAS codetext.
     * </p>
     * @return decoded HIBC PAS Complex Codetext or null.
     * @param encodedCodetext encoded codetext
     */
    static tryDecodeHIBCPAS(encodedCodetext)
    {
        let javaComplexCodetextReader = java.import(ComplexCodetextReader.javaClassName);
        let javaHIBCPAS = javaComplexCodetextReader.tryDecodeHIBCPASSync(encodedCodetext);
        if((javaHIBCPAS) == null)
            return null;
        return HIBCPASCodetext.construct(javaHIBCPAS);
    }
}

/**
 * SwissQR bill standard version
 * @enum
 */
QrBillStandardVersion =
    {
        /**
         *
         * Version 2.0
         *
         */
        V2_0: 0
    };

/**
 * SwissQR bill data
 */
class SwissQRBill extends joint.BaseJavaClass {
    creditor;
    debtor;

    init() {
        this.creditor = Address.construct(this.getJavaClass().getCreditorSync());
        this.debtor = Address.construct(this.getJavaClass().getDebtorSync());
    }

    constructor(javaClass) {
        super(javaClass);
        this.init();
    }

    static convertAlternativeSchemes(javaAlternativeSchemes) {
        let alternativeSchemes = [];
        for (let i = 0; i < javaAlternativeSchemes.sizeSync(); i++) {
            alternativeSchemes[i] = AlternativeScheme.construct(javaAlternativeSchemes.getSync(i));
        }
        return alternativeSchemes;
    }

    /**
     * Gets the version of the SwissQR bill standard.
     * @return The SwissQR bill standard version.
     */
    getVersion() {
        return this.getJavaClass().getVersionSync();
    }

    /**
     * Sets the version of the SwissQR bill standard.<br>
     * @param value The SwissQR bill standard version.
     */
    setVersion(value) {
        this.getJavaClass().setVersionSync(value);
    }

    /**
     * Gets the payment amount.<br>
     * <br>
     * Valid values are between 0.01 and 999,999,999.99.
     *
     * @return The payment amount.
     */
    getAmount() {
        return this.getJavaClass().getAmountSync();
    }

    /**
     * Sets the payment amount.<br>
     * Valid values are between 0.01 and 999,999,999.99.
     *
     * @param value The payment amount.
     */
    setAmount(value) {
        this.getJavaClass().setAmountSync(value);
    }

    /**
     * Gets the payment currency.<br>
     *
     * Valid values are "CHF" and "EUR".
     *
     * @return The payment currency.
     */
    getCurrency() {
        return this.getJavaClass().getCurrencySync();
    }

    /**
     * Sets the payment currency.<br>
     *
     * @param value Valid values are "CHF" and "EUR".
     */
    setCurrency(value) {
        this.getJavaClass().setCurrencySync(value);
    }

    /**
     * Gets the creditor's account number.<br>
     * <br>
     * Account numbers must be valid IBANs of a bank of Switzerland or<br>
     * Liechtenstein. Spaces are allowed in the account number.<br>
     *
     * @return The creditor account number.
     */
    getAccount() {
        return this.getJavaClass().getAccountSync();
    }

    /**
     * Sets the creditor's account number.<br>
     * <br>
     * Account numbers must be valid IBANs of a bank of Switzerland<br> or<br>
     * Liechtenstein. Spaces are allowed in the account number.
     *
     * @param value: The creditor account number.
     */
    setAccount(value) {
        this.getJavaClass().setAccountSync(value);
    }

    /**
     * Gets the creditor address.
     * @return The creditor address.
     */
    getCreditor() {
        return this.creditor;
    }

    /**
     * Sets the creditor address.
     * @param value: The creditor address.
     */
    setCreditor(value) {
        this.creditor = value;
        this.getJavaClass().setCreditorSync(value.getJavaClass());
    }

    /**
     * Gets the creditor payment reference.<br>
     * <br>
     * The reference is mandatory for SwissQR IBANs, i.e.IBANs in the range<br>
     * CHxx30000xxxxxx through CHxx31999xxxxx.<br>
     * <br>
     * If specified, the reference must be either a valid SwissQR reference<br>
     * (corresponding to ISR reference form) or a valid creditor reference<br>
     * according to ISO 11649 ("RFxxxx"). Both may contain spaces for formatting.<br>
     *
     * @return The creditor payment reference.
     */
    getReference() {
        return this.getJavaClass().getReferenceSync();
    }

    /**
     * Sets the creditor payment reference.<br>
     * <br>
     * The reference is mandatory for SwissQR IBANs, i.e.IBANs in the range<br>
     * CHxx30000xxxxxx through CHxx31999xxxxx.<br>
     * <br>
     * If specified, the reference must be either a valid SwissQR reference<br>
     * (corresponding to ISR reference form) or a valid creditor reference<br>
     * according to ISO 11649 ("RFxxxx"). Both may contain spaces for formatting.
     *
     * @param value The creditor payment reference.
     */
    setReference(value) {
        this.getJavaClass().setReferenceSync(value);
    }

    /**
     * Creates and sets a ISO11649 creditor reference from a raw string by prefixing<br>
     * the String with "RF" and the modulo 97 checksum.<br>
     * <br>
     * Whitespace is removed from the reference<br>
     * <br>
     * @exception ArgumentException rawReference contains invalid characters.
     * @param rawReference The raw reference.
     */
    createAndSetCreditorReference(rawReference) {
        this.getJavaClass().createAndSetCreditorReferenceSync(rawReference);
    }

    /**
     * Gets the debtor address.<br>
     * <br>
     * The debtor is optional. If it is omitted, both setting this field to<br>
     * null or setting an address with all null or empty values is ok.<br>
     * <br>
     * @return The debtor address.
     */
    getDebtor() {
        return this.debtor;
    }

    /**
     * Sets the debtor address.<br>
     * <br>
     * The debtor is optional. If it is omitted, both setting this field to<br>
     * null or setting an address with all null or empty values is ok.
     *
     * @param value: The debtor address.
     */
    setDebtor(value) {
        this.debtor = value;
        this.getJavaClass().setDebtorSync(value.getJavaClass());
    }

    /**
     * Gets the additional unstructured message.
     * @return The unstructured message.
     */
    getUnstructuredMessage() {
        return this.getJavaClass().getUnstructuredMessageSync();
    }

    /**
     * Sets the additional unstructured message.
     * @param value: The unstructured message.
     */
    setUnstructuredMessage(value) {
        this.getJavaClass().setUnstructuredMessageSync(value);
    }

    /**
     * Gets the additional structured bill information.
     * @return The structured bill information.
     */
    getBillInformation() {
        return this.getJavaClass().getBillInformationSync();
    }

    /**
     * Sets the additional structured bill information.
     * @param value: The structured bill information.
     */
    setBillInformation(value) {
        this.getJavaClass().setBillInformationSync(value);
    }

    /**
     * Gets ors sets the alternative payment schemes.<br>
     * <br>
     * A maximum of two schemes with parameters are allowed.
     *
     * @return The alternative payment schemes.
     */
    getAlternativeSchemes() {
        return SwissQRBill.convertAlternativeSchemes(this.getJavaClass().getAlternativeSchemesSync());
    }

    /**
     * Gets or sets the alternative payment schemes. <br>
     * <br>
     * A maximum of two schemes with parameters are allowed.<br>
     *
     * @param value: The alternative payment schemes.
     */
    setAlternativeSchemes(value) {
        let ArrayList = java.import('java.util.ArrayList');
        let javaArray = new ArrayList();
        for(let i = 0; i < value.length; i++)
        {
            javaArray.addSync(value[i].getJavaClass());
        }
        this.getJavaClass().setAlternativeSchemesSync(javaArray);
    }

    /**
     * Determines whether the specified object is equal to the current object.
     * @return true if the specified object is equal to the current object; otherwise, false.
     * @param obj The object to compare with the current object.
     */
    equals(obj) {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Gets the hash code for this instance.
     * @return A hash code for the current object.
     */
    hashCode() {
        return this.getJavaClass().hashCodeSync();
    }
}

/**
 * Class for encoding and decoding the text embedded in the SwissQR code.
 */
class SwissQRCodetext extends IComplexCodetext {
    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwSwissQRCodetext";
    bill;

    init() {
        this.bill = new SwissQRBill(this.getJavaClass().getBillSync());
    }

    /**
     * SwissQR bill data
     */
    getBill() {
        return this.bill;
    }

    /**
     * Creates an instance of SwissQRCodetext.
     *
     * @param bill SwissQR bill data
     * @throws BarcodeException
     */
    constructor(bill) {
        let java_class_link = java.import(SwissQRCodetext.javaClassName);
        let javaBill = null;
        if (bill == null)
        {
            javaBill = new java_class_link();
        }
        else
        {
            javaBill = new java_class_link(bill.getJavaClass());
        }
        super(javaBill);
        this.init();
    }

    static construct(javaClass)
    {
        let phpClass = new SwissQRCodetext(null);
        phpClass.setJavaClass(javaClass);
        return phpClass;
    }

    /**
     * Construct codetext from SwissQR bill data
     *
     * @return Constructed codetext
     */
    getConstructedCodetext() {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * Initializes Bill with constructed codetext.
     *
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext) {
        this.getJavaClass().initFromStringSync(constructedCodetext);
        this.init();
    }

    /**
     * Gets barcode type.
     *
     * @return Barcode type.
     */
    getBarcodeType() {
        return this.getJavaClass().getBarcodeTypeSync();
    }
}


/**
 * Class for encoding and decoding the text embedded in the 4-state Royal Mailmark code.
 */
class MailmarkCodetext extends IComplexCodetext
{
    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwMailmarkCodetext";
    /**
     * "0" – Null or Test<br>
     * "1" – Letter<br>
     * "2" – Large Letter
     */
    getFormat()
    { return this.getJavaClass().getFormatSync(); }
    /**
     * "0" – Null or Test<br>
     * "1" – LetterN<br>
     * "2" – Large Letter
     */
    setFormat(value)
    { this.getJavaClass().setFormatSync(value); }

    /**
     * Currently "1" – For Mailmark barcode (0 and 2 to 9 and A to Z spare for future use)
     */
    getVersionID()
    { return this.getJavaClass().getVersionIDSync(); }

    /**
     * Currently "1" – For Mailmark barcode (0 and 2 to 9 and A to Z spare for future use)
     */
    setVersionID(value)
    { this.getJavaClass().setVersionIDSync(value); }

    /**
     * "0" - Null or Test<br>
     * "1" - 1C (Retail)<br>
     * "2" - 2C (Retail)<br>
     * "3" - 3C (Retail)<br>
     * "4" - Premium (RetailPublishing Mail) (for potential future use)<br>
     * "5" - Deferred (Retail)<br>
     * "6" - Air (Retail) (for potential future use)<br>
     * "7" - Surface (Retail) (for potential future use)<br>
     * "8" - Premium (Network Access)<br>
     * "9" - Standard (Network Access)<br>
     */
    getClass_()
    {
        return this.getJavaClass().getClass_Sync();
    }

    /**
     * "0" - Null or Test<br>
     * "1" - 1C (Retail)<br>
     * "2" - 2C (Retail)<br>
     * "3" - 3C (Retail)<br>
     * "4" - Premium (RetailPublishing Mail) (for potential future use)<br>
     * "5" - Deferred (Retail)<br>
     * "6" - Air (Retail) (for potential future use)<br>
     * "7" - Surface (Retail) (for potential future use)<br>
     * "8" - Premium (Network Access)<br>
     * "9" - Standard (Network Access)
     */
    setClass_(value)
    {
        this.getJavaClass().setClassSync(value);
    }

    /**
     * Maximum values are 99 for Barcode C and 999999 for Barcode L.
     */
    getSupplychainID()
    { return this.getJavaClass().getSupplychainIDSync(); }
    /**
     * Maximum values are 99 for Barcode C and 999999 for Barcode L.
     */
    setSupplychainID(value)
    { this.getJavaClass().setSupplychainIDSync(value); }

    /**
     * Maximum value is 99999999.
     */
    getItemID()
    { return this.getJavaClass().getItemIDSync(); }

    /**
     * Maximum value is 99999999.
     */
    setItemID(value)
    { this.getJavaClass().setItemIDSync(value); }

    /**
     * The PC and DP must comply with a PAF format.<br>
     * Nine character string denoting international "XY11     " (note the 5 trailing spaces) or a pattern<br>
     * of characters denoting a domestic sorting code.<br>
     * A domestic sorting code consists of an outward postcode, an inward postcode, and a Delivery Point Suffix.
     */
    getDestinationPostCodePlusDPS()
    { return this.getJavaClass().getDestinationPostCodePlusDPSSync(); }

    /**
     * The PC and DP must comply with a PAF format.<br>
     * Nine character string denoting international "XY11     " (note the 5 trailing spaces) or a pattern<br>
     * of characters denoting a domestic sorting code.<br>
     * A domestic sorting code consists of an outward postcode, an inward postcode, and a Delivery Point Suffix.
     */
    setDestinationPostCodePlusDPS(value)
    { this.getJavaClass().setDestinationPostCodePlusDPSSync(value); }

    /**
     * Initializes a new instance of the {@code MailmarkCodetext} class.
     */
    constructor(mailmarkCodetext)
    {
        let java_class_link = java.import(MailmarkCodetext.javaClassName);
        let javaClass = null;
        if (mailmarkCodetext == null)
        {
            javaClass = new java_class_link();
        }
        else
        {
            javaClass = new java_class_link(mailmarkCodetext.getJavaClass());
        }
        super(javaClass);
    }

    init()
    {}

    /**
     * Construct codetext from Mailmark data.
     *
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * Initializes Mailmark data from constructed codetext.
     *
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * Gets barcode type.
     *
     * @return Barcode type.
     */
    getBarcodeType()
    {
        return this.getJavaClass().getBarcodeTypeSync();
    }
}

/**
 * Class for encoding and decoding the text embedded in the Royal Mail 2D Mailmark code.
 */
class Mailmark2DCodetext extends IComplexCodetext
{

    static javaClassName = "com.aspose.mw.barcode.complexbarcode.MwMailmark2DCodetext";

    static construct(javaClass)
    {
        let jsClass = new Mailmark2DCodetext();
        jsClass.setJavaClass(javaClass);
        return jsClass;
    }

    /**
     * Identifies the UPU Country ID.Max length: 4 characters.
     * @return Country ID
     */
    getUPUCountryID()
    {
        return this.getJavaClass().getUPUCountryIDSync();
    }

    /**
     * Identifies the UPU Country ID.Max length: 4 characters.
     * @param value Country ID
     */
    setUPUCountryID(value)
    {
        this.getJavaClass().setUPUCountryIDSync(value);
    }

    /**
     * Identifies the Royal Mail Mailmark barcode payload for each product type.<br>
     * Valid Values:<br>
     * <br>
     * '0' - Domestic Sorted &amp; Unsorted<br>
     * 'A' - Online Postage<br>
     * 'B' - Franking<br>
     * 'C' - Consolidation
     *
     * @return Information type ID
     */
    getInformationTypeID()
    {
        return this.getJavaClass().getInformationTypeIDSync();
    }

    /**
     * Identifies the Royal Mail Mailmark barcode payload for each product type.<br>
     * Valid Values:<br>
     * <br>
     * '0' - Domestic Sorted &amp; Unsorted<br>
     * 'A' - Online Postage<br>
     * 'B' - Franking<br>
     * 'C' - Consolidation
     *
     * @param value Information type ID
     */
    setInformationTypeID(value)
    {
        this.getJavaClass().setInformationTypeIDSync(value);
    }


    /**
     * Identifies the  barcode version as relevant to each Information Type ID.<br>
     * Valid Values:<br>
     * <br>
     * Currently '1'.<br>
     * '0' &amp; '2' to '9' and 'A' to 'Z' spare reserved for potential future use.
     *
     * @return Version ID
     */
    getVersionID()
    {
        return this.getJavaClass().getVersionIDSync();
    }

    /**
     * Identifies the  barcode version as relevant to each Information Type ID.<br>
     * Valid Values:<br>
     * <br>
     * Currently '1'.<br>
     * '0' &amp; '2' to '9' and 'A' to 'Z' spare reserved for potential future use.
     *
     * @param value Version ID
     */
    setVersionID(value)
    {
        this.getJavaClass().setVersionIDSync(value);
    }

    /**
     * Identifies the class of the item.<br>
     * <br>
     * Valid Values:<br>
     * '1' - 1C (Retail)<br>
     * '2' - 2C (Retail)<br>
     * '3' - Economy (Retail)<br>
     * '5' - Deffered (Retail)<br>
     * '8' - Premium (Network Access)<br>
     * '9' - Standard (Network Access)
     *
     * @return class of the item
     */
    getClass_()
    {
        return this.getJavaClass().getClass_Sync();
    }

    /**
     * Identifies the class of the item.<br>
     * <br>
     * Valid Values:<br>
     * '1' - 1C (Retail)<br>
     * '2' - 2C (Retail)<br>
     * '3' - Economy (Retail)<br>
     * '5' - Deffered (Retail)<br>
     * '8' - Premium (Network Access)<br>
     * '9' - Standard (Network Access)
     *
     * @param value  class of the item
     */
    setClass_(value)
    {
        this.getJavaClass().setclassSync(value);
    }

    /**
     * Identifies the unique group of customers involved in the mailing.<br>
     * Max value: 9999999.
     *
     * @return Supply chain ID
     */
    getSupplyChainID()
    {
        return this.getJavaClass().getSupplyChainIDSync();
    }

    /**
     * Identifies the unique group of customers involved in the mailing.<br>
     * Max value: 9999999.
     *
     * @param value  Supply chain ID
     */
    setSupplyChainID(value)
    {
        this.getJavaClass().setSupplyChainIDSync(value);
    }

    /**
     * Identifies the unique item within the Supply Chain ID.<br>
     * Every Mailmark barcode is required to carry an ID<br>
     * so it can be uniquely identified for at least 90 days.<br>
     * Max value: 99999999.
     *
     * @return item within the Supply Chain ID
     */
    getItemID()
    {
        return this.getJavaClass().getItemIDSync();
    }

    /**
     * Identifies the unique item within the Supply Chain ID.<br>
     * Every Mailmark barcode is required to carry an ID<br>
     * so it can be uniquely identified for at least 90 days.<br>
     * Max value: 99999999.
     *
     * @param value item within the Supply Chain ID
     */
    setItemID(value)
    {
        this.getJavaClass().setItemIDSync(value);
    }

    /**
     * Contains the Postcode of the Delivery Address with DPS<br>
     * If inland the Postcode/DP contains the following number of characters.<br>
     * Area (1 or 2 characters) District(1 or 2 characters)<br>
     * Sector(1 character) Unit(2 characters) DPS (2 characters).<br>
     * The Postcode and DPS must comply with a valid PAF® format.
     *
     * @return the Postcode of the Delivery Address with DPS
     */
    getDestinationPostCodeAndDPS()
    {
        return this.getJavaClass().getDestinationPostCodeAndDPSSync();
    }

    /**
     * Contains the Postcode of the Delivery Address with DPS<br>
     * If inland the Postcode/DP contains the following number of characters.<br>
     * Area (1 or 2 characters) District(1 or 2 characters)<br>
     * Sector(1 character) Unit(2 characters) DPS (2 characters).<br>
     * The Postcode and DPS must comply with a valid PAF® format.
     *
     * @param value  the Postcode of the Delivery Address with DPS
     */
    setDestinationPostCodeAndDPS(value)
    {
        this.getJavaClass().setDestinationPostCodeAndDPSSync(value);
    }

    /**
     * Flag which indicates what level of Return to Sender service is being requested.
     *
     * @return RTS Flag
     */
    getRTSFlag()
    {
        return this.getJavaClass().getRTSFlagSync();
    }

    /**
     * Flag which indicates what level of Return to Sender service is being requested.
     *
     * @return RTS Flag
     */
    setRTSFlag(value)
    {
        this.getJavaClass().setRTSFlagSync(value);
    }

    /**
     * Contains the Return to Sender Post Code but no DPS.<br>
     * The PC(without DPS) must comply with a PAF® format.
     *
     * @return Return to Sender Post Code but no DPS
     */
    getReturnToSenderPostCode()
    {
        return this.getJavaClass().getReturnToSenderPostCodeSync();
    }

    /**
     * Contains the Return to Sender Post Code but no DPS.<br>
     * The PC(without DPS) must comply with a PAF® format.
     *
     * @param value  Return to Sender Post Code but no DPS
     */
    setReturnToSenderPostCode(value)
    {
        this.getJavaClass().setReturnToSenderPostCodeSync(value);
    }

    /**
     * Optional space for use by customer.<br>
     * <br>
     * Max length by Type:<br>
     * Type 7: 6 characters<br>
     * Type 9: 45 characters<br>
     * Type 29: 25 characters
     *
     * @return Customer content
     */
    getCustomerContent()
    {
        return this.getJavaClass().getCustomerContentSync();
    }

    /**
     * Optional space for use by customer.<br>
     * <br>
     * Max length by Type:<br>
     * Type 7: 6 characters<br>
     * Type 9: 45 characters<br>
     * Type 29: 25 characters
     *
     * @param value  Customer content
     */
    setCustomerContent(value)
    {
        this.getJavaClass().setCustomerContentSync(value);
    }

    /**
     * Encode mode of Datamatrix barcode.<br>
     * Default value: DataMatrixEncodeMode.C40.
     *
     * @return Encode mode of Datamatrix barcode.
     */
    getCustomerContentEncodeMode()
    {
        return this.getJavaClass().getCustomerContentEncodeModeSync();
    }

    /**
     * Encode mode of Datamatrix barcode.<br>
     * Default value: DataMatrixEncodeMode.C40.
     *
     * @param value  Encode mode of Datamatrix barcode.
     */
    setCustomerContentEncodeMode(value)
    {
        this.getJavaClass().setCustomerContentEncodeModeSync(value);
    }

    /**
     * 2D Mailmark Type defines size of Data Matrix barcode.
     *
     * @return Size of Data Matrix barcode
     */
    getDataMatrixType()
    {
        return this.getJavaClass().getDataMatrixTypeSync();
    }

    /**
     * 2D Mailmark Type defines size of Data Matrix barcode.
     *
     * @param value  Size of Data Matrix barcode
     */
    setDataMatrixType(value)
    {
        this.getJavaClass().setDataMatrixTypeSync(value);
    }

    /**
     * Create default instance of Mailmark2DCodetext class.
     */
    constructor()
    {
        let java_class_link = java.import(Mailmark2DCodetext.javaClassName);
        super(new java_class_link());
        this.init();
    }

    init()
    {}

    /**
     * Construct codetext from Mailmark data.
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {

        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * Initializes Mailmark data from constructed codetext.
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * Gets barcode type.
     * @return Barcode type.
     */
    getBarcodeType()  {
        return EncodeTypes.DATA_MATRIX;
    }
}

/**
 * Base class for encoding and decoding the text embedded in the MaxiCode code.<br>
 * <br>
 * This sample shows how to decode raw MaxiCode codetext to MaxiCodeCodetext instance.
 *
 * @example
 * let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *      let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *      console.log("BarCode Type: " + resultMaxiCodeCodetext.getBarcodeType());
 *      console.log("MaxiCode mode: " + resultMaxiCodeCodetext.getMode());
 *      console.log("BarCode CodeText: " + resultMaxiCodeCodetext.getConstructedCodetext());
 * });
 */
class MaxiCodeCodetext extends IComplexCodetext
{
    /**
     * Gets MaxiCode mode.
     * @return MaxiCode mode
     */
    getMode()
    {

    }

    /**
     * Gets a MaxiCode encode mode.
     */
    getMaxiCodeEncodeMode()
    {
        return this.getJavaClass().getMaxiCodeEncodeModeSync();
    }

    /**
     * Sets a MaxiCode encode mode.
     */
    setMaxiCodeEncodeMode(value)
    {
        this.getJavaClass().setMaxiCodeEncodeModeSync(value);
    }

    /**
     * Gets ECI encoding. Used when MaxiCodeEncodeMode is AUTO.
     */
    getECIEncoding()
    {
        return this.getJavaClass().getECIEncodingSync();
    }

    /**
     * Sets ECI encoding. Used when MaxiCodeEncodeMode is AUTO.
     */
    setECIEncoding(value)
    {
        this.getJavaClass().setECIEncodingSync(value);
    }

    /**
     * Gets barcode type.
     * @return Barcode type
     */
    getBarcodeType()
    {
        return this.getJavaClass().getBarcodeTypeSync();
    }
}

/**
 * Class for encoding and decoding MaxiCode codetext for modes 4, 5 and 6.
 * @example
 * //Mode 4
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_4);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 * @example
 * //Mode 5
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_5);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 * @example
 * //Mode 6
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_6);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 */
class MaxiCodeSecondMessage extends joint.BaseJavaClass
{
    getMessage()
    {}
}

/**
 * Class for encoding and decoding MaxiCode codetext for modes 4, 5 and 6.
 *
 * @example
 * //Mode 4
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_4);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 * @example
 * //Mode 5
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_5);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 * @example
 * //Mode 6
 * let maxiCodeCodetext = new MaxiCodeStandardCodetext();
 * maxiCodeCodetext.setMode(MaxiCodeMode.MODE_6);
 * maxiCodeCodetext.setMessage("Test message");
 * let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext.getConstructedCodetext());
 * complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 */
class MaxiCodeStandardCodetext extends MaxiCodeCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStandardCodetext";

    constructor()
    {
        try
        {
            let java_class = java.import(MaxiCodeStandardCodetext.JAVA_CLASS_NAME);
            super(new java_class());
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    static construct(javaClass)
    {
        let _class = new MaxiCodeStandardCodetext();
        _class.setJavaClass(javaClass);

        return _class;
    }

    /**
     * Gets message.
     */
    getMessage()
    {
        return this.getJavaClass().getMessageSync();
    }

    /**
     * Sets message.
     */
    setMessage(value)
    {
        this.getJavaClass().setMessageSync(value);
    }

    /**
     * Sets MaxiCode mode. Standart codetext can be used only with modes 4, 5 and 6.
     */
    setMode(mode)
    {
        this.getJavaClass().setModeSync(mode);
    }

    /**
     * Gets MaxiCode mode.
     * @return MaxiCode mode
     */
    getMode()
    {
        return this.getJavaClass().getModeSync();
    }

    /**
     * Constructs codetext
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * Initializes instance from constructed codetext.
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified <see cref="MaxiCodeStandardCodetext"/> value.
     * @param obj An <see cref="MaxiCodeStandardCodetext"/> value to compare to this instance.
     * @return if obj has the same value as this instance; otherwise, <b>false</b>.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code
     */
    getHashCode()
    {
        return this.getJavaClass().getHashCodeSync();
    }

    init()
    {
    }
}

/**
 * Class for encoding and decoding standart second message for MaxiCode barcode.
 */
class MaxiCodeStandartSecondMessage extends MaxiCodeSecondMessage
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStandartSecondMessage";

    constructor()
    {
        try
        {
            let java_class_link = java.import(MaxiCodeStandartSecondMessage.JAVA_CLASS_NAME);
            let javaClass = new java_class_link();
            super(javaClass);
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    /**
     * Sets second message
     */
    setMessage(value)
    {
        this.getJavaClass().setMessageSync(value);
    }

    /**
     * Gets second message
     */
    getMessage()
    {
        return this.getJavaClass().getMessageSync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified <see cref="MaxiCodeStandartSecondMessage"/> value.
     * @param obj An <see cref="MaxiCodeStandartSecondMessage"/> value to compare to this instance
     * @return <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.<br>
     * @return A 32-bit signed integer hash code.
     */
    getHashCode()
    {
        return this.getJavaClass().getHashCodeSync();
    }

    init()
    {
    }
}

/**
 * Base class for encoding and decoding the text embedded in the MaxiCode code for modes 2 and 3.
 *
 *  @example
 *  This sample shows how to decode raw MaxiCode codetext to MaxiCodeStructuredCodetext instance.
 *
 *  let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *      let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *      if (resultMaxiCodeCodetext instanceof MaxiCodeStructuredCodetext)
 *      {
 *          let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
 *          console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
 *          console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
 *          console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
 *      }
 *  });
 */
class MaxiCodeStructuredCodetext extends MaxiCodeCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStructuredCodetext";

    maxiCodeSecondMessage;

    constructor(javaClass)
    {
        try
        {
            super(javaClass);
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    init()
    {
        let javaMaxiCodeSecondMessage = this.getJavaClass().getSecondMessage();
        let javaMaxiCodeStandartSecondMessageClass = java.import("com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStandartSecondMessage");
        let javaMaxiCodeStandartSecondMessage = new javaMaxiCodeStandartSecondMessageClass();
        let javaMaxiCodeStructuredSecondMessageClass = java.import("com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStructuredSecondMessage");
        let javaMaxiCodeStructuredSecondMessage = new javaMaxiCodeStructuredSecondMessageClass();

        if(javaMaxiCodeSecondMessage instanceof javaMaxiCodeStandartSecondMessage)
        {
            this.maxiCodeSecondMessage = new MaxiCodeStandartSecondMessage(this.getJavaClass().getSecondMessageSync());
        }
        else if(javaMaxiCodeSecondMessage instanceof javaMaxiCodeStructuredSecondMessage)
        {
            this.maxiCodeSecondMessage = new MaxiCodeStructuredSecondMessage(this.getJavaClass().getSecondMessageSync());
        }
    }

    /**
     * Identifies the postal code. Must be 9 digits in mode 2 or<br>
     * 6 alphanumeric symbols in mode 3.
     */
    getPostalCode()
    {
        return this.getJavaClass().getPostalCodeSync();
    }

    /**
     * Identifies the postal code. Must be 9 digits in mode 2 or
     * 6 alphanumeric symbols in mode 3.
     */
    setPostalCode(value)
    {
        this.getJavaClass().setPostalCodeSync(value);
    }

    /**
     * Identifies 3 digit country code.
     */
    getCountryCode()
    {
        return this.getJavaClass().getCountryCodeSync();
    }

    /**
     * Identifies 3 digit country code.
     */
    setCountryCode(value)
    {
        this.getJavaClass().setCountryCodeSync(value);
    }

    /**
     * Identifies 3 digit service category.
     */
    getServiceCategory()
    {
        return this.getJavaClass().getServiceCategorySync();
    }

    /**
     * Identifies 3 digit service category.
     */
    setServiceCategory(value)
    {
        this.getJavaClass().setServiceCategorySync(value);
    }

    /**
     * Identifies second message of the barcode.
     */
    getSecondMessage()
    {
        return this.maxiCodeSecondMessage;
    }

    /**
     * Identifies second message of the barcode.
     */
    setSecondMessage(value)
    {
        this.maxiCodeSecondMessage = value;
        this.getJavaClass().setSecondMessageSync(value.getJavaClass());
    }

    /**
     * Constructs codetext
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * Initializes instance from constructed codetext.
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified <see cref="MaxiCodeStructuredCodetext"/> value.
     * @param obj An <see cref="MaxiCodeStructuredCodetext"/> value to compare to this instance
     * @return <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code.
     */
    getHashCode()
    {
        return this.getJavaClass().getHashCodeSync();
    }
}

/**
 * Class for encoding and decoding the text embedded in the MaxiCode code for modes 2.
 *
 *  @example
 *  This sample shows how to encode and decode MaxiCode codetext for mode 2.
 *  //Mode 2 with standart second message
 *  let maxiCodeCodetext = new MaxiCodeCodetextMode2();
 *  maxiCodeCodetext.setPostalCode("524032140");
 *  maxiCodeCodetext.setCountryCode(056);
 *  maxiCodeCodetext.setServiceCategory(999);
 *  let maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
 *  maxiCodeStandartSecondMessage.setMessage("Test message");
 *  maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage);
 *  let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
 *  complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 *  @example
 *  //Mode 2 with structured second message
 *  let maxiCodeCodetext = new MaxiCodeCodetextMode2();
 *  maxiCodeCodetext.setPostalCode("524032140");
 *  maxiCodeCodetext.setCountryCode(056);
 *  maxiCodeCodetext.setServiceCategory(999);
 *  let maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
 *  maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE");
 *  maxiCodeStructuredSecondMessage.add("PITTSBURGH");
 *  maxiCodeStructuredSecondMessage.add("PA");
 *  maxiCodeStructuredSecondMessage.setYear(99);
 *  maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage);
 *  let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
 *  complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 *  @example
 *  //Decoding raw codetext with standart second message
 *  let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *     let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *     if (resultMaxiCodeCodetext instanceof MaxiCodeCodetextMode2)
 *     {
 *        let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
 *        console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
 *        console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
 *        console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
 *        if (maxiCodeStructuredCodetext.getSecondMessage() instanceof MaxiCodeStandartSecondMessage)
 *        {
 *            let secondMessage = maxiCodeStructuredCodetext.getSecondMessage();
 *            console.log("Message: " + secondMessage.getMessage());
 *        }
 *     }
 *  });
 *
 *  @example
 *  //Decoding raw codetext with structured second message
 *  let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *      let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *      if (resultMaxiCodeCodetext instanceof MaxiCodeCodetextMode2){
 *          let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
 *          console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
 *          console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
 *          console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
 *          if (maxiCodeStructuredCodetext.getSecondMessage() instanceof MaxiCodeStructuredSecondMessage){
 *              let secondMessage = maxiCodeStructuredCodetext.getSecondMessage();
 *              console.log("Message:");
 *              secondMessage.getIdentifiers().forEach(identifier,i, identifiers){
 *                  console.log(identifier);
 *              });
 *          }
 *      }
 *  });
 */
class MaxiCodeCodetextMode2 extends MaxiCodeStructuredCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeCodetextMode2";

    constructor()
    {
        try
        {
            let java_class_link = java.import(MaxiCodeCodetextMode2.JAVA_CLASS_NAME);
            let javaClass = new java_class_link();
            super(javaClass);
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    static construct(javaClass)
    {
        let _class = new MaxiCodeCodetextMode2();
        _class.setJavaClass(javaClass);

        return _class;
    }

    /**
     * Gets MaxiCode mode.
     * @return MaxiCode mode
     */
    getMode()
    {
        return this.getJavaClass().getModeSync();
    }

    init()
    {
        super.init();
    }
}

/**
 * Class for encoding and decoding the text embedded in the MaxiCode code for modes 3.<br>
 * This sample shows how to encode and decode MaxiCode codetext for mode 3.
 *  @example
 *  //Mode 3 with standart second message
 *  let maxiCodeCodetext = new MaxiCodeCodetextMode3();
 *  maxiCodeCodetext.setPostalCode("B1050");
 *  maxiCodeCodetext.setCountryCode(056);
 *  maxiCodeCodetext.setServiceCategory(999);
 *  let maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
 *  maxiCodeStandartSecondMessage.setMessage("Test message");
 *  maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage);
 *  let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
 *  complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 *  @example
 *  //Mode 3 with structured second message
 *  let maxiCodeCodetext = new MaxiCodeCodetextMode3();
 *  maxiCodeCodetext.setPostalCode("B1050");
 *  maxiCodeCodetext.setCountryCode(056);
 *  maxiCodeCodetext.setServiceCategory(999);
 *  let maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
 *  maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE");
 *  maxiCodeStructuredSecondMessage.add("PITTSBURGH");
 *  maxiCodeStructuredSecondMessage.add("PA");
 *  maxiCodeStructuredSecondMessage.setYear(99);
 *  maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage);
 *  let complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
 *  complexGenerator.generateBarCodeImage(BarcodeImageFormat.PNG);
 *
 *  @example
 *  //Decoding raw codetext with standart second message
 *  let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *      let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *      if (resultMaxiCodeCodetext instanceOf MaxiCodeCodetextMode3)
 *      {
 *          let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
 *          console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
 *          console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
 *          console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
 *          if (maxiCodeStructuredCodetext.getSecondMessage() instanceOf MaxiCodeStandartSecondMessage)
 *          {
 *              let secondMessage = maxiCodeStructuredCodetext.getSecondMessage();
 *              console.log("Message: " + secondMessage.getMessage());
 *          }
 *      }
 *  });
 *
 *  @example
 *
 *  //Decoding raw codetext with structured second message
 *  let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
 *  reader.readBarCodes().forEach(function(result, i, results)
 *  {
 *      let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
 *      if (resultMaxiCodeCodetext instanceOf MaxiCodeCodetextMode3)
 *      {
 *          let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
 *          console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
 *          console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
 *          console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
 *          if (maxiCodeStructuredCodetext.getSecondMessage() instanceOf MaxiCodeStructuredSecondMessage)
 *          {
 *              let secondMessage = maxiCodeStructuredCodetext.getSecondMessage();
 *              console.log("Message:");
 *              secondMessage.getIdentifiers().forEach(identifier,i, identifiers){
 *                  console.log(identifier);
 *              });
 *          }
 *      }
 *  });
 */
class MaxiCodeCodetextMode3 extends MaxiCodeStructuredCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeCodetextMode3";

    constructor()
    {
        try
        {
            let java_class_link = java.import(MaxiCodeCodetextMode3.JAVA_CLASS_NAME);
            let javaClass = new java_class_link();
            super(javaClass);
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    static construct(javaClass)
    {
        let _class = new MaxiCodeCodetextMode3();
        _class.setJavaClass(javaClass);

        return _class;
    }

    /**
     * Gets MaxiCode mode.
     * @return MaxiCode mode
     */
    getMode()
    {
        return this.getJavaClass().getMode();
    }

    init()
    {
        super.init();
    }
}

/**
 * Class for encoding and decoding structured second message for MaxiCode barcode.
 */
class MaxiCodeStructuredSecondMessage extends MaxiCodeSecondMessage
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwMaxiCodeStructuredSecondMessage";

    constructor()
    {
        try
        {
            let java_class = java.import(MaxiCodeStructuredSecondMessage.JAVA_CLASS_NAME);
            super(new java_class());
        }
        catch (ex)
        {
            throw new BarcodeException(ex.getMessage(), __FILE__, __LINE__);
        }
    }

    /**
     *  Gets year. Year must be 2 digit integer value.
     */
    getYear()
    {
        return this.getJavaClass().getYear();
    }

    /**
     *  Sets year. Year must be 2 digit integer value.
     */
    setYear(value)
    {
        this.getJavaClass().setYear(value);
    }

    /**
     *  Gets identifiers list
     * @return List of identifiers
     */
    getIdentifiers()
    {
        let identifiers_string = this.getJavaClass().getIdentifiersSync();
        let delimeter = "\\/\\";
        let identifiers = identifiers_string.split(delimeter);

        return identifiers;
    }

    /**
     * Adds new identifier
     * @param identifier Identifier to be added
     */
    add(identifier)
    {
        this.getJavaClass().addSync(identifier);
    }

    /**
     * Clear identifiers list
     */
    clear()
    {
        this.getJavaClass().clearSync();
    }

    /**
     * Gets constructed second message
     * @return Constructed second message
     */
    getMessage()
    {
        return this.getJavaClass().getMessageSync();
    }

    /**
     * Returns a value indicating whether this instance is equal to a specified <see cref="MaxiCodeStructuredSecondMessage"/> value.
     * @param obj "obj">An <see cref="MaxiCodeStructuredSecondMessage"/> value to compare to this instance.
     * @return <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * Returns the hash code for this instance.
     * @return A 32-bit signed integer hash code.
     */
    getHashCode()
    {
        return this.getJavaClass().getHashCodeSync();
    }

    init()
    {
    }
}

/**
 * Base class for encoding and decoding the text embedded in the HIBC LIC code.<br>
 * <br>
 * This sample shows how to decode raw HIBC LIC codetext to HIBCLICComplexCodetext instance.
 * @example
 * let reader = new BarCodeReader("c:\\test.png", null, DecodeType.HIBC_AZTEC_LIC);
 * reader.readBarCodes().forEach(function(result, i, results)
 * {
 *    let resultHIBCLICComplexCodetext = ComplexCodetextReader.tryDecodeHIBCLIC(result.getCodeText());
 *    print("BarCode Type: " + resultMaxiCodeCodetext.getBarcodeType());
 *    print("BarCode CodeText: " + resultMaxiCodeCodetext.getConstructedCodetext());
 * });
 */
class HIBCLICComplexCodetext extends IComplexCodetext
{
    constructor(javaClass)
    {
        super(javaClass);
    }
    /**
     * <p>
     * Constructs codetext
     * </p>
     * @return Constructed codetext
     */
    getConstructedCodetext(){}

    /**
     * <p>
     * Initializes instance from constructed codetext.
     * </p>
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext){}

    /**
     * <p>
     * Gets or sets barcode type. HIBC LIC codetext can be encoded using HIBCCode39LIC, HIBCCode128LIC, HIBCAztecLIC, HIBCDataMatrixLIC and HIBCQRLIC encode types.
     * Default value: HIBCCode39LIC.
     * </p>
     * @return Barcode type.
     */
    getBarcodeType()
    {
        return this.getJavaClass().getBarcodeTypeSync();
    }
    /**
     * <p>
     * Gets or sets barcode type. HIBC LIC codetext can be encoded using HIBCCode39LIC, HIBCCode128LIC, HIBCAztecLIC, HIBCDataMatrixLIC and HIBCQRLIC encode types.
     * Default value: HIBCCode39LIC.
     * </p>
     * @return Barcode type.
     */
    setBarcodeType(value)
    {
        this.getJavaClass().setBarcodeTypeSync(value);
    }
}

/**
 * <p>
 * Class for encoding and decoding the text embedded in the HIBC LIC code which stores primary and secodary data.
 * </p>
 * This sample shows how to encode and decode HIBC LIC using HIBCLICCombinedCodetext.
 *
 * @example
 *
 * let combinedCodetext = new HIBCLICCombinedCodetext();
 * combinedCodetext.setBarcodeType(EncodeTypes.HIBCQRLIC);
 * combinedCodetext.setPrimaryData(new PrimaryData());
 * combinedCodetext.getPrimaryData().setProductOrCatalogNumber("12345");
 * combinedCodetext.getPrimaryData().setLabelerIdentificationCode("A999");
 * combinedCodetext.getPrimaryData().setUnitOfMeasureID(1);
 * combinedCodetext.setSecondaryAndAdditionalData(new SecondaryAndAdditionalData());
 * combinedCodetext.getSecondaryAndAdditionalData().setExpiryDate(new Date());
 * combinedCodetext.getSecondaryAndAdditionalData().setExpiryDateFormat(HIBCLICDateFormat.MMDDYY);
 * combinedCodetext.getSecondaryAndAdditionalData().setQuantity(30);
 * combinedCodetext.getSecondaryAndAdditionalData().setLotNumber("LOT123");
 * combinedCodetext.getSecondaryAndAdditionalData().setSerialNumber("SERIAL123");
 * combinedCodetext.getSecondaryAndAdditionalData().setDateOfManufacture(new Date());
 * ComplexBarcodeGenerator generator = new ComplexBarcodeGenerator(combinedCodetext);
 * let image = generator.generateBarCodeImage(BarCodeImageFormat.PNG);
 * let reader = new BarCodeReader(image, null, DecodeType.HIBCQRLIC);
 * reader.readBarCodes();
 * let codetext = reader.getFoundBarCodes()[0].getCodeText();
 * let result = ComplexCodetextReader.tryDecodeHIBCLIC(codetext) ;
 * print("Product or catalog number: " + result.getPrimaryData().getProductOrCatalogNumber());
 * print("Labeler identification code: " + result.getPrimaryData().getLabelerIdentificationCode());
 * print("Unit of measure ID: " + result.getPrimaryData().getUnitOfMeasureID());
 * print("Expiry date: " + result.getSecondaryAndAdditionalData().getExpiryDate());
 * print("Quantity: " + result.getSecondaryAndAdditionalData().getQuantity());
 * print("Lot number: " + result.getSecondaryAndAdditionalData().getLotNumber());
 * print("Serial number: " + result.getSecondaryAndAdditionalData().getSerialNumber());
 * print("Date of manufacture: " + result.getSecondaryAndAdditionalData().getDateOfManufacture());
 */
class HIBCLICCombinedCodetext extends HIBCLICComplexCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwHIBCLICCombinedCodetext";

    constructor()
    {
        let java_class_link = java.import(HIBCLICCombinedCodetext.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    static construct(javaClass)
    {
        let obj = new HIBCLICCombinedCodetext();
        obj.setJavaClass(javaClass);
        return obj;
    }

    init()
    {
        this.auto_PrimaryData = PrimaryData.construct(this.getJavaClass().getPrimaryDataSync());
        this.auto_SecondaryAndAdditionalData = SecondaryAndAdditionalData.construct(this.getJavaClass().getSecondaryAndAdditionalDataSync());
    }

    /**
     * <p>
     * Identifies primary data.
     * </p>
     */
    getPrimaryData()
    {
        return this.auto_PrimaryData;
    }

    /**
     * <p>
     * Identifies primary data.
     * </p>
     */
    setPrimaryData(value)
    {
        this.getJavaClass().setPrimaryDataSync(value.getJavaClass());
        this.auto_PrimaryData = value;
    }

    auto_PrimaryData;

    /**
     * <p>
     * Identifies secondary and additional supplemental data.
     * </p>
     */
    getSecondaryAndAdditionalData()
    {
        return this.auto_SecondaryAndAdditionalData;
    }

    /**
     * <p>
     * Identifies secondary and additional supplemental data.
     * </p>
     */
    setSecondaryAndAdditionalData(value)
    {
        this.getJavaClass().setSecondaryAndAdditionalDataSync(value.getJavaClass());
        this.auto_SecondaryAndAdditionalData = value;
    }

    auto_SecondaryAndAdditionalData;

    /**
     * <p>
     * Constructs codetext
     * </p>
     *
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * <p>
     * Initializes instance from constructed codetext.
     * </p>
     *
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code HIBCLICCombinedCodetext} value.
     * </p>
     *
     * @param obj An {@code HIBCLICCombinedCodetext} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }
}

/**
 * <p>
 * Class for encoding and decoding the text embedded in the HIBC LIC code which stores primary data.
 * </p>
 * This sample shows how to encode and decode HIBC LIC using HIBCLICPrimaryCodetext.
 * @example
 * let complexCodetext  = new HIBCLICPrimaryCodetext();
 * complexCodetext.setBarcodeType(EncodeTypes.HIBCQRLIC);
 * complexCodetext.setData(new PrimaryData());
 * complexCodetext.getData().setProductOrCatalogNumber("12345");
 * complexCodetext.getData().setLabelerIdentificationCode("A999");
 * complexCodetext.getData().setUnitOfMeasureID(1);
 * let generator = new ComplexBarcodeGenerator(complexCodetext);
 * let image = generator.generateBarCodeImage(BarCodeImageFormat.PNG);
 * let reader = new BarCodeReader(image, null, DecodeType.HIBCQRLIC);
 * reader.readBarCodes();
 * let codetext = reader.getFoundBarCodes()[0].getCodeText();
 * let result = ComplexCodetextReader.tryDecodeHIBCLIC(codetext) ;
 * print("Product or catalog number: " + result.getData().getProductOrCatalogNumber());
 * print("Labeler identification code: " + result.getData().getLabelerIdentificationCode());
 * print("Unit of measure ID: " + result.getData().getUnitOfMeasureID());
 */
class HIBCLICPrimaryDataCodetext extends HIBCLICComplexCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwHIBCLICPrimaryDataCodetext";

    constructor()
    {
        let java_class_link = java.import(HIBCLICPrimaryDataCodetext.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    static construct(java_class)
    {
        let obj = new HIBCLICPrimaryDataCodetext();
        obj.setJavaClass(java_class);
        return obj;
    }

    init()
    {
        this.data = PrimaryData.construct(this.getJavaClass().getDataSync());
    }

    data;

    /**
     * <p>
     * Identifies primary data.
     * </p>
     */
    getData()
    {
        return this.data;
    }

    /**
     * <p>
     * Identifies primary data.
     * </p>
     */
    setData(value)
    {
        this.getJavaClass().setDataSync(value.getJavaClass());
        this.data = value;
    }

    /**
     * <p>
     * Constructs codetext
     * </p>
     *
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * <p>
     * Initializes instance from constructed codetext.
     * </p>
     *
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code HIBCLICPrimaryDataCodetext} value.
     * </p>
     *
     * @param obj An {@code HIBCLICPrimaryDataCodetext} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }
}

/**
 * Class for encoding and decoding the text embedded in the HIBC LIC code which stores seconday data.
 * @example
 * This sample shows how to encode and decode HIBC LIC using HIBCLICSecondaryAndAdditionalDataCodetext.
 *
 * @code
 * let complexCodetext = new HIBCLICSecondaryAndAdditionalDataCodetext();
 * complexCodetext.setBarcodeType(EncodeTypes.HIBCQRLIC);
 * complexCodetext.setLinkCharacter('L');
 * complexCodetext.setData(new SecondaryAndAdditionalData());
 * complexCodetext.getData().setExpiryDate(new Date());
 * complexCodetext.getData().setExpiryDateFormat(HIBCLICDateFormat.MMDDYY);
 * complexCodetext.getData().setQuantity(30);
 * complexCodetext.getData().setLotNumber("LOT123");
 * complexCodetext.getData().setSerialNumber("SERIAL123");
 * complexCodetext.getData().setDateOfManufacture(new Date());
 * let generator = new ComplexBarcodeGenerator(complexCodetext);
 * let image = generator.generateBarCodeImage(BarcodeImageFormat.PNG);
 * let reader = new BarCodeReader(image, null, DecodeType.HIBCQRLIC);
 * reader.readBarCodes();
 * codetext = reader.getFoundBarCodes()[0].getCodeText();
 * result = ComplexCodetextReader.tryDecodeHIBCLIC(codetext);
 * print("Expiry date: " + result.getData().getExpiryDate());
 * print("Quantity: " + result.getData().getQuantity());
 * print("Lot number: " + result.getData().getLotNumber());
 * print("Serial number: " + result.getData().getSerialNumber());
 * print("Date of manufacture: " + result.getData().getDateOfManufacture());
 * </code>
 * </example>
 */
class HIBCLICSecondaryAndAdditionalDataCodetext extends HIBCLICComplexCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwHIBCLICSecondaryAndAdditionalDataCodetext";
    data;

    constructor()
    {
        let java_class_link = java.import(HIBCLICSecondaryAndAdditionalDataCodetext.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    static construct(java_class)
    {
        let obj = new HIBCLICSecondaryAndAdditionalDataCodetext();
        obj.setJavaClass(java_class);
        return obj;
    }

    /**
     * <p>
     * Identifies secodary and additional supplemental data.
     * </p>
     */
    getData()
    {
        return this.data;
    }

    /**
     * <p>
     * Identifies secodary and additional supplemental data.
     * </p>
     */
    setData(value)
    {
        this.getJavaClass().setDataSync(value.getJavaClass());
        this.data = value;
    }

    /**
     * <p>
     * Identifies link character.
     * </p>
     */
    getLinkCharacter()
    {
        return this.getJavaClass().getLinkCharacterSync();
    }

    /**
     * <p>
     * Identifies link character.
     * </p>
     */
    setLinkCharacter(value)
    {
        this.getJavaClass().setLinkCharacterSync(value);
    }

    /**
     * <p>
     * Constructs codetext
     * </p>
     *
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * <p>
     * Initializes instance from constructed codetext.
     * </p>
     *
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code HIBCLICSecondaryAndAdditionalDataCodetext} value.
     * </p>
     *
     * @param obj An {@code HIBCLICSecondaryAndAdditionalDataCodetext} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    init()
    {
        this.data = SecondaryAndAdditionalData.construct(this.getJavaClass().getDataSync());
    }
}

/**
 * <p>
 *  Class for encoding and decoding the text embedded in the HIBC PAS code.
 * @example
 *
 *  This sample shows how to encode and decode HIBC PAS using HIBCPASCodetext.
 *
 *  let complexCodetext = new HIBCPASComplexCodetext();
 *  complexCodetext.setDataLocation(HIBCPASDataLocation.PATIENT);
 *  complexCodetext.addRecord(HIBCPASDataType.LABELER_IDENTIFICATION_CODE, "A123");
 *  complexCodetext.addRecord(HIBCPASDataType.MANUFACTURER_SERIAL_NUMBER, "SERIAL123");
 *  complexCodetext.setBarcodeType(EncodeTypes.HIBC_DATA_MATRIX_PAS);
 *  let generator = new ComplexBarcodeGenerator(complexCodetext);
 *  BarCodeReader reader = new BarCodeReader(generator.generateBarCodeImage(BarCodeImageFormat.PNG), null, DecodeType.HIBC_DATA_MATRIX_PAS);
 *  reader.readBarCodes();
 *  let codetext = reader.getFoundBarCodes()[0].getCodeText();
 * 	let readCodetext = ComplexCodetextReader.tryDecodeHIBCPAS(codetext);
 *  print("Data location: " + readCodetext.getDataLocation());
 *  print("Data type: " + readCodetext.getRecords()[0].getDataType());
 *  print("Data: " + readCodetext.getRecords()[0].getData());
 *  print("Data type: " + readCodetext.getRecords()[1].getDataType());
 *  print("Data: " + readCodetext.getRecords()[1].getData());
 */
class HIBCPASCodetext extends IComplexCodetext
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwHIBCPASCodetext";

    constructor()
    {
        let java_class_link = java.import(HIBCPASCodetext.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    /**
     * <p>
     * HIBCPASRecord constructor
     * </p>
     */
    static construct(javaClass)
    {
        let obj = new HIBCPASCodetext();
        obj.setJavaClass(javaClass);
        return obj;
    }

    init()
    {

    }

    /**
     * <p>
     * Gets or sets barcode type. HIBC PAS codetext can be encoded using HIBCCode39PAS, HIBCCode128PAS, HIBCAztec:PAS, HIBCDataMatrixPAS and HIBCQRPAS encode types.
     * Default value: HIBCCode39PAS.
     * </p>
     * @return Barcode type.
     */
    setBarcodeType(value)
    {
        this.getJavaClass().setBarcodeTypeSync(value);
    }

    /**
     * <p>
     * Identifies data location.
     * </p>
     */
    getDataLocation()
    {
        return this.getJavaClass().getDataLocationSync();
    }
    /**
     * <p>
     * Identifies data location.
     * </p>
     */
    setDataLocation(value)
    {
        this.getJavaClass().setDataLocationSync(value);
    }

    /**
     * <p>
     * Gets records list
     * </p>
     * @return List of records
     */
    getRecords()
    {
        let _array = [];
        let mwRecordsList = this.getJavaClass().getRecordsSync();
        let listSize = mwRecordsList.sizeSync();
        for (let i = 0; i < listSize; i++)
        {
            let mwhibcpasRecord = mwRecordsList.getSync(i);
            _array.push(HIBCPASRecord.construct(mwhibcpasRecord));
        }
        return _array;
    }

    /**
     * <p>
     * Adds new record
     * </p>
     * @param dataType Type of data
     * @param data Data string
     */
    addRecord(dataType, data)
    {
        this.getJavaClass().addRecordSync(dataType, data);
    }

    /**
     * <p>
     * Adds new record
     * </p>
     * @param record Record to be added
     */
    addHIBCPASRecord(record)
    {
        this.getJavaClass().addRecordSync(record.getJavaClass());
    }

    /**
     * <p>
     * Clears records list
     * </p>
     */
    clear()
    {
        this.getJavaClass().clearSync();
    }

    /**
     * <p>
     * Gets barcode type.
     * </p>
     * @return Barcode type.
     */
    getBarcodeType()
    {
        return this.getJavaClass().getBarcodeTypeSync();
    }

    /**
     * <p>
     * Constructs codetext
     * </p>
     * @return Constructed codetext
     */
    getConstructedCodetext()
    {
        return this.getJavaClass().getConstructedCodetextSync();
    }

    /**
     * <p>
     * Initializes instance from constructed codetext.
     * </p>
     * @param constructedCodetext Constructed codetext.
     */
    initFromString(constructedCodetext)
    {
        this.getJavaClass().initFromStringSync(constructedCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code HIBCPASCodetext} value.
     * </p>
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     * @param obj An {@code HIBCPASCodetext} value to compare to this instance.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }
}

/**
 * <p>
 * Class for storing HIBC PAS record.
 * </p>
 */
class HIBCPASRecord extends joint.BaseJavaClass
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwHIBCPASRecord";

    /**
     * <p>
     * HIBCPASRecord constructor
     * </p>
     *
     * @param dataType Type of data.
     * @param data     Data string.
     */
    constructor(dataType, data)
    {
        let java_class_link = java.import(HIBCPASRecord.JAVA_CLASS_NAME);
        let javaClass = new java_class_link(dataType, data);
        super(javaClass);
    }

    /**
     * <p>
     * HIBCPASRecord constructor
     * </p>
     */
    static construct(javaClass)
    {
        let obj = new HIBCPASRecord(0,"");
        obj.setJavaClass(javaClass);
        return obj;
    }

    init()
    {}

    /**
     * <p>
     * Identifies data type.
     * </p>
     */
    getDataType()
    {
        return this.getJavaClass().getDataTypeSync();
    }

    /**
     * <p>
     * Identifies data type.
     * </p>
     */
    setDataType(value)
    {
        this.getJavaClass().setDataTypeSync(value);
    }

    /**
     * <p>
     * Identifies data.
     * </p>
     */
    getData()
    {
        return this.getJavaClass().getDataSync();
    }

    /**
     * <p>
     * Identifies data.
     * </p>
     */
    setData(value)
    {
        this.getJavaClass().setDataSync(value);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code HIBCPASDataType} value.
     * </p>
     *
     * @param obj An {@code HIBCPASDataType} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }
}


/**
 * <p>
 * Class for storing HIBC LIC primary data.
 * </p>
 */
class PrimaryData extends joint.BaseJavaClass
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwPrimaryData";

    constructor()
    {
        let java_class_link = java.import(PrimaryData.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    static construct(java_class)
    {
        let obj = new PrimaryData();
        obj.setJavaClass(java_class);
        return obj;
    }

    /**
     * <p>
     * Identifies date of labeler identification code.<br>
     * Labeler identification code must be 4 symbols alphanumeric string, with first character always being alphabetic.
     * </p>
     */
    getLabelerIdentificationCode()
    {
        return this.getJavaClass().getLabelerIdentificationCodeSync();
    }

    /**
     * <p>
     * Identifies date of labeler identification code.<br>
     * Labeler identification code must be 4 symbols alphanumeric string, with first character always being alphabetic.
     * </p>
     */
    setLabelerIdentificationCode(value)
    {
        this.getJavaClass().setLabelerIdentificationCodeSync(value);
    }

    /**
     * <p>
     * Identifies product or catalog number. Product or catalog number must be alphanumeric string up to 18 sybmols length.
     * </p>
     */
    getProductOrCatalogNumber()
    {
        return this.getJavaClass().getProductOrCatalogNumberSync();
    }

    /**
     * <p>
     * Identifies product or catalog number. Product or catalog number must be alphanumeric string up to 18 sybmols length.
     * </p>
     */
    setProductOrCatalogNumber(value)
    {
        this.getJavaClass().setProductOrCatalogNumberSync(value);
    }

    /**
     * <p>
     * Identifies unit of measure ID. Unit of measure ID must be integer value from 0 to 9.
     * </p>
     */
    getUnitOfMeasureID()
    {
        return this.getJavaClass().getUnitOfMeasureIDSync();
    }

    /**
     * <p>
     * Identifies unit of measure ID. Unit of measure ID must be integer value from 0 to 9.
     * </p>
     */
    setUnitOfMeasureID(value)
    {
        this.getJavaClass().setUnitOfMeasureIDSync(value);
    }

    /**
     * <p>
     * Converts data to string format according HIBC LIC specification.
     * </p>
     *
     * @return Formatted string.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }

    /**
     * <p>
     * Instantiates primary data from string format according HIBC LIC specification.
     * </p>
     *
     * @param primaryDataCodetext Formatted string.
     */
    parseFromString(primaryDataCodetext)
    {
        this.getJavaClass().parseFromStringSync(primaryDataCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code PrimaryData} value.
     * </p>
     *
     * @param obj An {@code PrimaryData} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    init()
    {}
}

/**
 * <p>
 * Class for storing HIBC LIC secondary and additional data.
 * </p>
 */
class SecondaryAndAdditionalData extends joint.BaseJavaClass
{
    static JAVA_CLASS_NAME = "com.aspose.mw.barcode.complexbarcode.MwSecondaryAndAdditionalData";

    constructor()
    {
        let java_class_link = java.import(SecondaryAndAdditionalData.JAVA_CLASS_NAME);
        let javaClass = new java_class_link();
        super(javaClass);
    }

    static construct(java_class)
    {
        let obj = new SecondaryAndAdditionalData();
        obj.setJavaClass(java_class);
        return obj;
    }

    /**
     * <p>
     * Identifies expiry date format.
     * </p>
     */
    getExpiryDateFormat()
    {
        return this.getJavaClass().getExpiryDateFormatSync();
    }

    /**
     * <p>
     * Identifies expiry date format.
     * </p>
     */
    setExpiryDateFormat(value)
    {
        this.getJavaClass().setExpiryDateFormatSync(value);
    }

    /**
     * <p>
     * Identifies expiry date. Will be used if ExpiryDateFormat is not set to None.
     * </p>
     */
    getExpiryDate()
    {
        return new Date(this.getJavaClass().getExpiryDateSync() * 1000);
    }
    /**
     * <p>
     * Identifies expiry date. Will be used if ExpiryDateFormat is not set to None.
     * </p>
     */
    setExpiryDate(value)
    {
        this.getJavaClass().setExpiryDateSync((value.getTime() / 1000).toString());
    }

    /**
     * <p>
     * Identifies lot or batch number. Lot/batch number must be alphanumeric string with up to 18 sybmols length. .
     * </p>
     */
    getLotNumber()
    {
        return this.getJavaClass().getLotNumberSync();
    }

    /**
     * <p>
     * Identifies lot or batch number. Lot/batch number must be alphanumeric string with up to 18 sybmols length. .
     * </p>
     */
    setLotNumber(value)
    {
        if(value == null)
            value = "null";
        this.getJavaClass().setLotNumberSync(value);
    }

    /**
     * <p>
     * Identifies serial number. Serial number must be alphanumeric string up to 18 sybmols length.
     * </p>
     */
    getSerialNumber()
    {
        return this.getJavaClass().getSerialNumberSync();
    }

    /**
     * <p>
     * Identifies serial number. Serial number must be alphanumeric string up to 18 sybmols length.
     * </p>
     */
    setSerialNumber(value)
    {
        if(value == null)
            value = "null";
        this.getJavaClass().setSerialNumberSync(value);
    }

    /**
     * <p>
     * Identifies date of manufacture.
     * Date of manufacture can be set to DateTime.MinValue in order not to use this field.
     * Default value: DateTime.MinValue
     * </p>
     */
    getDateOfManufacture()
    {
        return new Date(this.getJavaClass().getDateOfManufactureSync() * 1000);
    }

    /**
     * <p>
     * Identifies date of manufacture.
     * Date of manufacture can be set to DateTime.MinValue in order not to use this field.
     * Default value: DateTime.MinValue
     * </p>
     */
    setDateOfManufacture(value)
    {
        this.getJavaClass().setDateOfManufactureSync((value.getTime() / 1000).toString());
    }

    /**
     * Identifies quantity, must be integer value from 0 to 500.<br>
     * Quantity can be set to -1 in order not to use this field.<br>
     * Default value: -1
     */
    getQuantity()
    {
        return this.getJavaClass().getQuantitySync();
    }

    /**
     * <p>
     * Identifies quantity, must be integer value from 0 to 500.
     * Quantity can be set to -1 in order not to use this field.
     * Default value: -1
     * </p>
     */
    setQuantity(value)
    {
        this.getJavaClass().setQuantitySync(value);
    }

    /**
     * <p>
     * Converts data to string format according HIBC LIC specification.
     * </p>
     *
     * @return Formatted string.
     */
    toString()
    {
        return this.getJavaClass().toStringSync();
    }

    /**
     * <p>
     * Instantiates secondary and additional supplemental data from string format according HIBC LIC specification.
     * </p>
     *
     * @param secondaryDataCodetext Formatted string.
     */
    parseFromString(secondaryDataCodetext)
    {
        this.getJavaClass().parseFromStringSync(secondaryDataCodetext);
    }

    /**
     * <p>
     * Returns a value indicating whether this instance is equal to a specified {@code SecondaryAndAdditionalData} value.
     * </p>
     *
     * @param obj An {@code SecondaryAndAdditionalData} value to compare to this instance.
     * @return {@code <b>true</b>} if obj has the same value as this instance; otherwise, {@code <b>false</b>}.
     */
    equals(obj)
    {
        return this.getJavaClass().equalsSync(obj.getJavaClass());
    }

    /**
     * <p>
     * Returns the hash code for this instance.
     * </p>
     *
     * @return A 32-bit signed integer hash code.
     */
    hashCode()
    {
        return this.getJavaClass().hashCodeSync();
    }

    init()
    {}
}

/**
 * 2D Mailmark Type defines size of Data Matrix barcode
 * @enum
 */
Mailmark2DType =
    {
        /**
         * Auto determine
         */
        AUTO: 0,

        /**
         * 24 x 24 modules
         */
        TYPE_7: 1,

        /**
         * 32 x 32 modules
         */
        TYPE_9: 2,

        /**
         * 16 x 48 modules
         */
        TYPE_29: 3
    }

/**
 * <p>
 * Specifies the different types of date formats for HIBC LIC.
 * </p>
 */
HIBCLICDateFormat =
    {
        /**
         * <p>
         * YYYYMMDD format. Will be encoded in additional supplemental data.
         * </p>
         */
        YYYYMMDD: 0,
        /**
         * <p>
         * MMYY format.
         * </p>
         */
        MMYY: 1,
        /**
         * <p>
         * MMDDYY format.
         * </p>
         */
        MMDDYY: 2,
        /**
         * <p>
         * YYMMDD format.
         * </p>
         */
        YYMMDD: 3,
        /**
         * <p>
         * YYMMDDHH format.
         * </p>
         */
        YYMMDDHH: 4,
        /**
         * <p>
         * Julian date format.
         * </p>
         */
        YYJJJ: 5,
        /**
         * <p>
         * Julian date format with hours.
         * </p>
         */
        YYJJJHH: 6,
        /**
         * <p>
         * Do not encode expiry date.
         * </p>
         */
        NONE:7
    }

/**
 * <p>
 * HIBC PAS data location types.
 * </p>
 */
HIBCPASDataLocation =
    {
        /**
         * <p>
         * A - Patient
         * </p>
         */
        PATIENT: 0,
        /**
         * <p>
         * B - Patient Care Record
         * </p>
         */
        PATIENT_CARE_RECORD: 1,
        /**
         * <p>
         * C - Specimen Container
         * </p>
         */
        SPECIMEN_CONTAINER: 2,
        /**
         * <p>
         * D - Direct Patient Image Item
         * </p>
         */
        DIRECT_PATIENT_IMAGE_ITEM: 3,
        /**
         * <p>
         * E - Business Record
         * </p>
         */
        BUSINESS_RECORD: 4,
        /**
         * <p>
         * F - Medical Administration Record
         * </p>
         */
        MEDICAL_ADMINISTRATION_RECORD: 5,
        /**
         * <p>
         * G - Library Reference Material
         * </p>
         */
        LIBRARY_REFERENCE_MATERIAL: 6,
        /**
         * <p>
         * H - Devices and Materials
         * </p>
         */
        DEVICES_AND_MATERIALS: 7,
        /**
         * <p>
         * I - Identification Card
         * </p>
         */
        IDENTIFICATION_CARD: 8,
        /**
         * <p>
         * J - Product Container
         * </p>
         */
        PRODUCT_CONTAINER: 9,
        /**
         * <p>
         * K - Asset data type
         * </p>
         */
        ASSET: 10,
        /**
         * <p>
         * L - Surgical Instrument
         * </p>
         */
        SURGICAL_INSTRUMENT: 11,
        /**
         * <p>
         * Z - User Defined
         * </p>
         */
        USER_DEFINED: 25
    }

/**
 * <p>
 * HIBC PAS record's data types.
 * </p>
 */
HIBCPASDataType =
    {
        /**
         * <p>
         * A - Labeler Identification Code
         * </p>
         */
        LABELER_IDENTIFICATION_CODE: 0,
        /**
         * <p>
         * B - Service Identification
         * </p>
         */
        SERVICE_IDENTIFICATION: 1,
        /**
         * <p>
         * C - Patient Identification
         * </p>
         */
        PATIENT_IDENTIFICATION: 2,
        /**
         * <p>
         * D - Specimen Identification
         * </p>
         */
        SPECIMEN_IDENTIFICATION: 3,
        /**
         * <p>
         * E - Personnel Identification
         * </p>
         */
        PERSONNEL_IDENTIFICATION: 4,
        /**
         * <p>
         * F - Administrable Product Identification
         * </p>
         */
        ADMINISTRABLE_PRODUCT_IDENTIFICATION: 5,
        /**
         * <p>
         * G - Implantable Product Information
         * </p>
         */
        IMPLANTABLE_PRODUCT_INFORMATION: 6,
        /**
         * <p>
         * H - Hospital Item Identification
         * </p>
         */
        HOSPITAL_ITEM_IDENTIFICATION: 7,
        /**
         * <p>
         * I - Medical Procedure Identification
         * </p>
         */
        MEDICAL_PROCEDURE_IDENTIFICATION: 8,
        /**
         * <p>
         * J - Reimbursement Category
         * </p>
         */
        REIMBURSEMENT_CATEGORY: 9,
        /**
         * <p>
         * K - Blood Product Identification
         * </p>
         */
        BLOOD_PRODUCT_IDENTIFICATION: 10,
        /**
         * <p>
         * L - Demographic Data
         * </p>
         */
        DEMOGRAPHIC_DATA: 11,
        /**
         * <p>
         * M - DateTime in YYYDDDHHMMG format
         * </p>
         */
        DATE_TIME: 12,
        /**
         * <p>
         * N - Asset Identification
         * </p>
         */
        ASSET_IDENTIFICATION: 13,
        /**
         * <p>
         * O - Purchase Order Number
         * </p>
         */
        PURCHASE_ORDER_NUMBER: 14,
        /**
         * <p>
         * P - Dietary Item Identification
         * </p>
         */
        DIETARY_ITEM_IDENTIFICATION: 15,
        /**
         * <p>
         * Q - Manufacturer Serial Number
         * </p>
         */
        MANUFACTURER_SERIAL_NUMBER: 16,
        /**
         * <p>
         * R - Library Materials Identification
         * </p>
         */
        LIBRARY_MATERIALS_IDENTIFICATION: 17,
        /**
         * <p>
         * S - Business Control Number
         * </p>
         */
        BUSINESS_CONTROL_NUMBER: 18,
        /**
         * <p>
         * T - Episode of Care Identification
         * </p>
         */
        EPISODE_OF_CARE_IDENTIFICATION: 19,
        /**
         * <p>
         * U - Health Industry Number
         * </p>
         */
        HEALTH_INDUSTRY_NUMBER: 20,
        /**
         * <p>
         * V - Patient Visit ID
         * </p>
         */
        PATIENT_VISIT_ID: 21,
        /**
         * <p>
         * X - XML Document
         * </p>
         */
        XML_DOCUMENT: 22,
        /**
         * <p>
         * Z - User Defined
         * </p>
         */
        USER_DEFINED: 25
    }

module.exports = {
    SwissQRCodetext,
    ComplexBarcodeGenerator,
    ComplexCodetextReader,
    AlternativeScheme,
    Address,
    AddressType,
    SwissQRBill,
    Mailmark2DCodetext,
    MailmarkCodetext,
    Mailmark2DType,
    QrBillStandardVersion,
    MaxiCodeStandardCodetext,
    MaxiCodeSecondMessage,
    MaxiCodeStructuredSecondMessage,
    MaxiCodeCodetextMode3,
    MaxiCodeCodetextMode2,
    MaxiCodeCodetext,
    HIBCLICCombinedCodetext,
    HIBCLICComplexCodetext,
    HIBCLICPrimaryDataCodetext,
    HIBCLICSecondaryAndAdditionalDataCodetext,
    HIBCPASCodetext,
    HIBCPASRecord,
    PrimaryData,
    SecondaryAndAdditionalData,
    HIBCLICDateFormat,
    HIBCPASDataType
};