<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for DiagnosticResult StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:DiagnosticResult
 * @subpackage Structs
 */
class DiagnosticResult extends AbstractStructBase
{
    /**
     * The exception
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var DiagnosticException
     */
    public $exception;
    /**
     * The must
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $must;
    /**
     * The name
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $name;
    /**
     * The parameters
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var ArrayOfDiagnosticParameter
     */
    public $parameters;
    /**
     * The state
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $state;
    /**
     * Constructor method for DiagnosticResult
     * @uses DiagnosticResult::setException()
     * @uses DiagnosticResult::setMust()
     * @uses DiagnosticResult::setName()
     * @uses DiagnosticResult::setParameters()
     * @uses DiagnosticResult::setState()
     * @param DiagnosticException $exception
     * @param bool $must
     * @param string $name
     * @param ArrayOfDiagnosticParameter $parameters
     * @param string $state
     */
    public function __construct(DiagnosticException $exception = null, $must = null, $name = null, ArrayOfDiagnosticParameter $parameters = null, $state = null)
    {
        $this
            ->setException($exception)
            ->setMust($must)
            ->setName($name)
            ->setParameters($parameters)
            ->setState($state);
    }
    /**
     * Get exception 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 DiagnosticException|null
     */
    public function getException()
    {
        return isset($this->exception) ? $this->exception : null;
    }
    /**
     * Set exception 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 DiagnosticException $exception
     * @return DiagnosticResult
     */
    public function setException(DiagnosticException $exception = null)
    {
        if (is_null($exception) || (is_array($exception) && empty($exception))) {
            unset($this->exception);
        } else {
            $this->exception = $exception;
        }
        return $this;
    }
    /**
     * Get must value
     * @return bool|null
     */
    public function getMust()
    {
        return $this->must;
    }
    /**
     * Set must value
     * @param bool $must
     * @return DiagnosticResult
     */
    public function setMust($must = null)
    {
        $this->must = $must;
        return $this;
    }
    /**
     * Get name 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 getName()
    {
        return isset($this->name) ? $this->name : null;
    }
    /**
     * Set name 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 $name
     * @return DiagnosticResult
     */
    public function setName($name = null)
    {
        if (is_null($name) || (is_array($name) && empty($name))) {
            unset($this->name);
        } else {
            $this->name = $name;
        }
        return $this;
    }
    /**
     * Get parameters 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 ArrayOfDiagnosticParameter|null
     */
    public function getParameters()
    {
        return isset($this->parameters) ? $this->parameters : null;
    }
    /**
     * Set parameters 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 ArrayOfDiagnosticParameter $parameters
     * @return DiagnosticResult
     */
    public function setParameters(ArrayOfDiagnosticParameter $parameters = null)
    {
        if (is_null($parameters) || (is_array($parameters) && empty($parameters))) {
            unset($this->parameters);
        } else {
            $this->parameters = $parameters;
        }
        return $this;
    }
    /**
     * Get state 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 getState()
    {
        return isset($this->state) ? $this->state : null;
    }
    /**
     * Set state 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 $state
     * @return DiagnosticResult
     */
    public function setState($state = null)
    {
        if (is_null($state) || (is_array($state) && empty($state))) {
            unset($this->state);
        } else {
            $this->state = $state;
        }
        return $this;
    }
}
