"use strict";

/**
 * Licensed Materials - Property of IBM
 * IBM Cognos Products: Cognos Analytics
 * Copyright IBM Corp. 2015, 2017
 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */
define(['bi/admin/globalparameters/helpers/SoapHelper'], function (SoapHelper) {
  function SimpleParmValueItem() {
    //NOSONAR
    this._inclusive = true;
    this._use = '';
    this._display = '';
  }

  SimpleParmValueItem.prototype.fromJSON = function (json) {
    if (json.inclusive) {
      this._inclusive = json.inclusive;
    }

    if (json.use) {
      this._use = json.use;
    }

    if (json.display) {
      this._display = json.display;
    }
  };

  SimpleParmValueItem.prototype.toXML = function (nodeName) {
    var simpleParmValueItem = '<' + nodeName + ' xsi:type="bus:simpleParmValueItem">' + '<inclusive xsi:type="xsd:boolean">' + this._inclusive + '</inclusive>' + '<display xsi:type="xsd:string">' + SoapHelper.xml_encode(this._display) + '</display>' + '<use xsi:type="xsd:string">' + SoapHelper.xml_encode(this._use) + '</use>' + '</' + nodeName + '>';
    return simpleParmValueItem;
  };

  return SimpleParmValueItem;
});