<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for StringStringPair StructType
 * @subpackage Structs
 */
class StringStringPair extends AnyEntity
{
    /**
     * The String1
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $String1;
    /**
     * The String2
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $String2;
    /**
     * Constructor method for StringStringPair
     * @uses StringStringPair::setString1()
     * @uses StringStringPair::setString2()
     * @param string $string1
     * @param string $string2
     */
    public function __construct($string1 = null, $string2 = null)
    {
        $this
            ->setString1($string1)
            ->setString2($string2);
    }
    /**
     * Get String1 value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getString1()
    {
        return isset($this->String1) ? $this->String1 : null;
    }
    /**
     * Set String1 value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $string1
     * @return \patest\StructType\StringStringPair
     */
    public function setString1($string1 = null)
    {
        // validation for constraint: string
        if (!is_null($string1) && !is_string($string1)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($string1, true), gettype($string1)), __LINE__);
        }
        if (is_null($string1) || (is_array($string1) && empty($string1))) {
            unset($this->String1);
        } else {
            $this->String1 = $string1;
        }
        return $this;
    }
    /**
     * Get String2 value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return string|null
     */
    public function getString2()
    {
        return isset($this->String2) ? $this->String2 : null;
    }
    /**
     * Set String2 value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param string $string2
     * @return \patest\StructType\StringStringPair
     */
    public function setString2($string2 = null)
    {
        // validation for constraint: string
        if (!is_null($string2) && !is_string($string2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($string2, true), gettype($string2)), __LINE__);
        }
        if (is_null($string2) || (is_array($string2) && empty($string2))) {
            unset($this->String2);
        } else {
            $this->String2 = $string2;
        }
        return $this;
    }
}
