<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SerializedCompactListOfOptionsOfstring StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SerializedCompactListOfOptionsOfstring
 * @subpackage Structs
 */
class SerializedCompactListOfOptionsOfstring extends SerializedCompactListOfstring
{
    /**
     * The DefaultValue
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $DefaultValue;
    /**
     * The Options
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfstring
     */
    public $Options;
    /**
     * Constructor method for SerializedCompactListOfOptionsOfstring
     * @uses SerializedCompactListOfOptionsOfstring::setDefaultValue()
     * @uses SerializedCompactListOfOptionsOfstring::setOptions()
     * @param string $defaultValue
     * @param \patest\ArrayType\ArrayOfstring $options
     */
    public function __construct($defaultValue = null, \patest\ArrayType\ArrayOfstring $options = null)
    {
        $this
            ->setDefaultValue($defaultValue)
            ->setOptions($options);
    }
    /**
     * Get DefaultValue 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 getDefaultValue()
    {
        return isset($this->DefaultValue) ? $this->DefaultValue : null;
    }
    /**
     * Set DefaultValue 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 $defaultValue
     * @return \patest\StructType\SerializedCompactListOfOptionsOfstring
     */
    public function setDefaultValue($defaultValue = null)
    {
        // validation for constraint: string
        if (!is_null($defaultValue) && !is_string($defaultValue)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($defaultValue, true), gettype($defaultValue)), __LINE__);
        }
        if (is_null($defaultValue) || (is_array($defaultValue) && empty($defaultValue))) {
            unset($this->DefaultValue);
        } else {
            $this->DefaultValue = $defaultValue;
        }
        return $this;
    }
    /**
     * Get Options 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 \patest\ArrayType\ArrayOfstring|null
     */
    public function getOptions()
    {
        return isset($this->Options) ? $this->Options : null;
    }
    /**
     * Set Options 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 \patest\ArrayType\ArrayOfstring $options
     * @return \patest\StructType\SerializedCompactListOfOptionsOfstring
     */
    public function setOptions(\patest\ArrayType\ArrayOfstring $options = null)
    {
        if (is_null($options) || (is_array($options) && empty($options))) {
            unset($this->Options);
        } else {
            $this->Options = $options;
        }
        return $this;
    }
}
