<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for remoteServerinfo StructType
 * Meta informations extracted from the WSDL
 * - documentation: This tag has been deprecated in 8.5. Use destinations instead. | This tag has been deprecated in 8.5. Use destinations instead.
 * @subpackage Structs
 */
class RemoteServerinfo extends AbstractStructBase
{
    /**
     * The server1
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - maxLength: 255
     * @var string
     */
    public $server1;
    /**
     * The server2
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - maxLength: 255
     * @var string
     */
    public $server2;
    /**
     * The server3
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - maxLength: 255
     * @var string
     */
    public $server3;
    /**
     * Constructor method for remoteServerinfo
     * @uses RemoteServerinfo::setServer1()
     * @uses RemoteServerinfo::setServer2()
     * @uses RemoteServerinfo::setServer3()
     * @param string $server1
     * @param string $server2
     * @param string $server3
     */
    public function __construct($server1 = null, $server2 = null, $server3 = null)
    {
        $this
            ->setServer1($server1)
            ->setServer2($server2)
            ->setServer3($server3);
    }
    /**
     * Get server1 value
     * @return string|null
     */
    public function getServer1()
    {
        return $this->server1;
    }
    /**
     * Set server1 value
     * @param string $server1
     * @return RemoteServerinfo
     */
    public function setServer1($server1 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($server1) && strlen($server1) > 255) || (is_array($server1) && count($server1) > 255)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 255 element(s) or a scalar of 255 character(s) at most, "%d" length given', is_scalar($server1) ? strlen($server1) : count($server1)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($server1) && !is_string($server1)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($server1)), __LINE__);
        }
        $this->server1 = $server1;
        return $this;
    }
    /**
     * Get server2 value
     * @return string|null
     */
    public function getServer2()
    {
        return $this->server2;
    }
    /**
     * Set server2 value
     * @param string $server2
     * @return RemoteServerinfo
     */
    public function setServer2($server2 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($server2) && strlen($server2) > 255) || (is_array($server2) && count($server2) > 255)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 255 element(s) or a scalar of 255 character(s) at most, "%d" length given', is_scalar($server2) ? strlen($server2) : count($server2)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($server2) && !is_string($server2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($server2)), __LINE__);
        }
        $this->server2 = $server2;
        return $this;
    }
    /**
     * Get server3 value
     * @return string|null
     */
    public function getServer3()
    {
        return $this->server3;
    }
    /**
     * Set server3 value
     * @param string $server3
     * @return RemoteServerinfo
     */
    public function setServer3($server3 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($server3) && strlen($server3) > 255) || (is_array($server3) && count($server3) > 255)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 255 element(s) or a scalar of 255 character(s) at most, "%d" length given', is_scalar($server3) ? strlen($server3) : count($server3)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($server3) && !is_string($server3)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($server3)), __LINE__);
        }
        $this->server3 = $server3;
        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 RemoteServerinfo
     */
    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__;
    }
}
