<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XLoadInformation StructType
 * @subpackage Structs
 */
class XLoadInformation extends AbstractStructBase
{
    /**
     * The _
     * @var string
     */
    public $_;
    /**
     * The special
     * Meta informations extracted from the WSDL
     * - pattern: (t)|(f)|(true)|(false)|(0)|(1)
     * @var string
     */
    public $special;
    /**
     * Constructor method for XLoadInformation
     * @uses XLoadInformation::set_()
     * @uses XLoadInformation::setSpecial()
     * @param string $_
     * @param string $special
     */
    public function __construct($_ = null, $special = null)
    {
        $this
            ->set_($_)
            ->setSpecial($special);
    }
    /**
     * Get _ value
     * @return string|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param string $_
     * @return XLoadInformation
     */
    public function set_($_ = null)
    {
        // validation for constraint: string
        if (!is_null($_) && !is_string($_)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
    /**
     * Get special value
     * @return string|null
     */
    public function getSpecial()
    {
        return $this->special;
    }
    /**
     * Set special value
     * @param string $special
     * @return XLoadInformation
     */
    public function setSpecial($special = null)
    {
        // validation for constraint: pattern
        if (is_scalar($special) && !preg_match('/(t)|(f)|(true)|(false)|(0)|(1)/', $special)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "(t)|(f)|(true)|(false)|(0)|(1)", "%s" given', var_export($special, true)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($special) && !is_string($special)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($special)), __LINE__);
        }
        $this->special = $special;
        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 XLoadInformation
     */
    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__;
    }
}
