<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for StreetNmbr StructType
 * @package Dg
 * @subpackage Structs
 */
class DgStreetNmbr extends DgStreetNmbrType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgStreetNmbrType
     */
    public $_;
    /**
     * The StreetNmbrSuffix
     * @var string
     */
    public $StreetNmbrSuffix;
    /**
     * The StreetDirection
     * @var string
     */
    public $StreetDirection;
    /**
     * The RuralRouteNmbr
     * @var string
     */
    public $RuralRouteNmbr;
    /**
     * Constructor method for StreetNmbr
     * @uses DgStreetNmbr::set_()
     * @uses DgStreetNmbr::setStreetNmbrSuffix()
     * @uses DgStreetNmbr::setStreetDirection()
     * @uses DgStreetNmbr::setRuralRouteNmbr()
     * @param \dgsoft\StructType\DgStreetNmbrType $_
     * @param string $streetNmbrSuffix
     * @param string $streetDirection
     * @param string $ruralRouteNmbr
     */
    public function __construct(\dgsoft\StructType\DgStreetNmbrType $_ = null, $streetNmbrSuffix = null, $streetDirection = null, $ruralRouteNmbr = null)
    {
        $this
            ->set_($_)
            ->setStreetNmbrSuffix($streetNmbrSuffix)
            ->setStreetDirection($streetDirection)
            ->setRuralRouteNmbr($ruralRouteNmbr);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgStreetNmbrType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgStreetNmbrType $_
     * @return \dgsoft\StructType\DgStreetNmbr
     */
    public function set_(\dgsoft\StructType\DgStreetNmbrType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get StreetNmbrSuffix value
     * @return string|null
     */
    public function getStreetNmbrSuffix()
    {
        return $this->StreetNmbrSuffix;
    }
    /**
     * Set StreetNmbrSuffix value
     * @param string $streetNmbrSuffix
     * @return \dgsoft\StructType\DgStreetNmbr
     */
    public function setStreetNmbrSuffix($streetNmbrSuffix = null)
    {
        // validation for constraint: string
        if (!is_null($streetNmbrSuffix) && !is_string($streetNmbrSuffix)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($streetNmbrSuffix)), __LINE__);
        }
        $this->StreetNmbrSuffix = $streetNmbrSuffix;
        return $this;
    }
    /**
     * Get StreetDirection value
     * @return string|null
     */
    public function getStreetDirection()
    {
        return $this->StreetDirection;
    }
    /**
     * Set StreetDirection value
     * @param string $streetDirection
     * @return \dgsoft\StructType\DgStreetNmbr
     */
    public function setStreetDirection($streetDirection = null)
    {
        // validation for constraint: string
        if (!is_null($streetDirection) && !is_string($streetDirection)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($streetDirection)), __LINE__);
        }
        $this->StreetDirection = $streetDirection;
        return $this;
    }
    /**
     * Get RuralRouteNmbr value
     * @return string|null
     */
    public function getRuralRouteNmbr()
    {
        return $this->RuralRouteNmbr;
    }
    /**
     * Set RuralRouteNmbr value
     * @param string $ruralRouteNmbr
     * @return \dgsoft\StructType\DgStreetNmbr
     */
    public function setRuralRouteNmbr($ruralRouteNmbr = null)
    {
        // validation for constraint: string
        if (!is_null($ruralRouteNmbr) && !is_string($ruralRouteNmbr)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ruralRouteNmbr)), __LINE__);
        }
        $this->RuralRouteNmbr = $ruralRouteNmbr;
        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 \dgsoft\StructType\DgStreetNmbr
     */
    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__;
    }
}
