<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for RowDetailsTypeAirRowCharacteristics StructType
 * @package Dg
 * @subpackage Structs
 */
class DgRowDetailsTypeAirRowCharacteristics extends AbstractStructBase
{
    /**
     * The CharacteristicList
     * @var string[]
     */
    public $CharacteristicList;
    /**
     * Constructor method for RowDetailsTypeAirRowCharacteristics
     * @uses DgRowDetailsTypeAirRowCharacteristics::setCharacteristicList()
     * @param string[] $characteristicList
     */
    public function __construct(array $characteristicList = array())
    {
        $this
            ->setCharacteristicList($characteristicList);
    }
    /**
     * Get CharacteristicList value
     * @return string[]|null
     */
    public function getCharacteristicList()
    {
        return $this->CharacteristicList;
    }
    /**
     * Set CharacteristicList value
     * @throws \InvalidArgumentException
     * @param string[] $characteristicList
     * @return \dgsoft\StructType\DgRowDetailsTypeAirRowCharacteristics
     */
    public function setCharacteristicList(array $characteristicList = array())
    {
        foreach ($characteristicList as $rowDetailsTypeAirRowCharacteristicsCharacteristicListItem) {
            // validation for constraint: itemType
            if (!is_string($rowDetailsTypeAirRowCharacteristicsCharacteristicListItem)) {
                throw new \InvalidArgumentException(sprintf('The CharacteristicList property can only contain items of string, "%s" given', is_object($rowDetailsTypeAirRowCharacteristicsCharacteristicListItem) ? get_class($rowDetailsTypeAirRowCharacteristicsCharacteristicListItem) : gettype($rowDetailsTypeAirRowCharacteristicsCharacteristicListItem)), __LINE__);
            }
        }
        $this->CharacteristicList = $characteristicList;
        return $this;
    }
    /**
     * Add item to CharacteristicList value
     * @throws \InvalidArgumentException
     * @param string $item
     * @return \dgsoft\StructType\DgRowDetailsTypeAirRowCharacteristics
     */
    public function addToCharacteristicList($item)
    {
        // validation for constraint: itemType
        if (!is_string($item)) {
            throw new \InvalidArgumentException(sprintf('The CharacteristicList property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->CharacteristicList[] = $item;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgRowDetailsTypeAirRowCharacteristics
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
