complex-barcode/maxicode-standard-second-message.js

const MaxiCodeSecondMessage = require("./maxicode-second-message");
const  BarcodeException  = require("../barcode-exception");
const {MwMaxiCodeStandardSecondMessage} = require("../_mwbridge/_mw-bridge");

/**
 * Class for encoding and decoding standart second message for MaxiCode barcode.
 */
class MaxiCodeStandardSecondMessage extends MaxiCodeSecondMessage
{
    constructor()
    {
        try
        {
            let java_class_link = MwMaxiCodeStandardSecondMessage;
            let mwObject = new java_class_link();
            super(mwObject);
        }
        catch (ex)
        {
            throw new BarcodeException(ex);
        }
    }

    static _fromMwObject(mwObject)
    {
        let _class = new MaxiCodeStandardSecondMessage();
        _class.setJavaClass(mwObject);

        return _class;
    }

    /**
     * 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="MaxiCodeStandardSecondMessage"/> value.
     * @param obj An <see cref="MaxiCodeStandardSecondMessage"/> 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();
    }

    _initializeWrapperMembers()
    {
    }
}

module.exports = MaxiCodeStandardSecondMessage