<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_HotelRoomSize StructType
 * @subpackage Structs
 */
class JP_HotelRoomSize extends AbstractStructBase
{
    /**
     * The Unit
     * Meta informations extracted from the WSDL
     * - use: required
     * @var string
     */
    public $Unit;
    /**
     * The _
     * @var float
     */
    public $_;
    /**
     * Constructor method for JP_HotelRoomSize
     * @uses JP_HotelRoomSize::setUnit()
     * @uses JP_HotelRoomSize::set_()
     * @param string $unit
     * @param float $_
     */
    public function __construct($unit = null, $_ = null)
    {
        $this
            ->setUnit($unit)
            ->set_($_);
    }
    /**
     * Get Unit value
     * @return string
     */
    public function getUnit()
    {
        return $this->Unit;
    }
    /**
     * Set Unit value
     * @uses \EnumType\JP_HotelRoomSizeUnitType::valueIsValid()
     * @uses \EnumType\JP_HotelRoomSizeUnitType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $unit
     * @return \StructType\JP_HotelRoomSize
     */
    public function setUnit($unit = null)
    {
        // validation for constraint: enumeration
        if (!\EnumType\JP_HotelRoomSizeUnitType::valueIsValid($unit)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $unit, implode(', ', \EnumType\JP_HotelRoomSizeUnitType::getValidValues())), __LINE__);
        }
        $this->Unit = $unit;
        return $this;
    }
    /**
     * Get _ value
     * @return float|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param float $_
     * @return \StructType\JP_HotelRoomSize
     */
    public function set_($_ = null)
    {
        $this->_ = $_;
        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 \StructType\JP_HotelRoomSize
     */
    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__;
    }
}
