<?php

namespace GreenwayDirectService;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for instructions StructType
 * @subpackage Structs
 */
class Instructions extends AbstractStructBase
{
    /**
     * The line1
     * Meta informations extracted from the WSDL
     * - maxLength: 50
     * @var string
     */
    public $line1;
    /**
     * The line2
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - maxLength: 50
     * @var string
     */
    public $line2;
    /**
     * The line3
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - maxLength: 50
     * @var string
     */
    public $line3;
    /**
     * The line4
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - maxLength: 50
     * @var string
     */
    public $line4;
    /**
     * Constructor method for instructions
     * @uses Instructions::setLine1()
     * @uses Instructions::setLine2()
     * @uses Instructions::setLine3()
     * @uses Instructions::setLine4()
     * @param string $line1
     * @param string $line2
     * @param string $line3
     * @param string $line4
     */
    public function __construct($line1 = null, $line2 = null, $line3 = null, $line4 = null)
    {
        $this
            ->setLine1($line1)
            ->setLine2($line2)
            ->setLine3($line3)
            ->setLine4($line4);
    }
    /**
     * Get line1 value
     * @return string|null
     */
    public function getLine1()
    {
        return $this->line1;
    }
    /**
     * Set line1 value
     * @param string $line1
     * @return \GreenwayDirectService\Instructions
     */
    public function setLine1($line1 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($line1) && strlen($line1) > 50) || (is_array($line1) && count($line1) > 50)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 50 element(s) or a scalar of 50 character(s) at most, "%d" length given', is_scalar($line1) ? strlen($line1) : count($line1)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($line1) && !is_string($line1)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($line1)), __LINE__);
        }
        $this->line1 = $line1;
        return $this;
    }
    /**
     * Get line2 value
     * @return string|null
     */
    public function getLine2()
    {
        return $this->line2;
    }
    /**
     * Set line2 value
     * @param string $line2
     * @return \GreenwayDirectService\Instructions
     */
    public function setLine2($line2 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($line2) && strlen($line2) > 50) || (is_array($line2) && count($line2) > 50)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 50 element(s) or a scalar of 50 character(s) at most, "%d" length given', is_scalar($line2) ? strlen($line2) : count($line2)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($line2) && !is_string($line2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($line2)), __LINE__);
        }
        $this->line2 = $line2;
        return $this;
    }
    /**
     * Get line3 value
     * @return string|null
     */
    public function getLine3()
    {
        return $this->line3;
    }
    /**
     * Set line3 value
     * @param string $line3
     * @return \GreenwayDirectService\Instructions
     */
    public function setLine3($line3 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($line3) && strlen($line3) > 50) || (is_array($line3) && count($line3) > 50)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 50 element(s) or a scalar of 50 character(s) at most, "%d" length given', is_scalar($line3) ? strlen($line3) : count($line3)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($line3) && !is_string($line3)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($line3)), __LINE__);
        }
        $this->line3 = $line3;
        return $this;
    }
    /**
     * Get line4 value
     * @return string|null
     */
    public function getLine4()
    {
        return $this->line4;
    }
    /**
     * Set line4 value
     * @param string $line4
     * @return \GreenwayDirectService\Instructions
     */
    public function setLine4($line4 = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($line4) && strlen($line4) > 50) || (is_array($line4) && count($line4) > 50)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 50 element(s) or a scalar of 50 character(s) at most, "%d" length given', is_scalar($line4) ? strlen($line4) : count($line4)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($line4) && !is_string($line4)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($line4)), __LINE__);
        }
        $this->line4 = $line4;
        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 \GreenwayDirectService\Instructions
     */
    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__;
    }
}
