<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for RSNMPCommunityString1 StructType
 * @subpackage Structs
 */
class RSNMPCommunityString1 extends AbstractStructBase
{
    /**
     * The accessPrivilege
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $accessPrivilege;
    /**
     * The ArrayOfHosts
     * @var RArrayOfHosts
     */
    public $ArrayOfHosts;
    /**
     * Constructor method for RSNMPCommunityString1
     * @uses RSNMPCommunityString1::setAccessPrivilege()
     * @uses RSNMPCommunityString1::setArrayOfHosts()
     * @param string $accessPrivilege
     * @param RArrayOfHosts $arrayOfHosts
     */
    public function __construct($accessPrivilege = null, RArrayOfHosts $arrayOfHosts = null)
    {
        $this
            ->setAccessPrivilege($accessPrivilege)
            ->setArrayOfHosts($arrayOfHosts);
    }
    /**
     * Get accessPrivilege value
     * @return string|null
     */
    public function getAccessPrivilege()
    {
        return $this->accessPrivilege;
    }
    /**
     * Set accessPrivilege value
     * @param string $accessPrivilege
     * @return RSNMPCommunityString1
     */
    public function setAccessPrivilege($accessPrivilege = null)
    {
        // validation for constraint: string
        if (!is_null($accessPrivilege) && !is_string($accessPrivilege)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($accessPrivilege)), __LINE__);
        }
        $this->accessPrivilege = $accessPrivilege;
        return $this;
    }
    /**
     * Get ArrayOfHosts value
     * @return RArrayOfHosts|null
     */
    public function getArrayOfHosts()
    {
        return $this->ArrayOfHosts;
    }
    /**
     * Set ArrayOfHosts value
     * @param RArrayOfHosts $arrayOfHosts
     * @return RSNMPCommunityString1
     */
    public function setArrayOfHosts(RArrayOfHosts $arrayOfHosts = null)
    {
        $this->ArrayOfHosts = $arrayOfHosts;
        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 RSNMPCommunityString1
     */
    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__;
    }
}
