<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_HotelRoomSize StructType
 * @subpackage Structs
 */
class JP_HotelRoomSize extends AbstractStructBase
{
    /**
     * The Unit
     * Meta information 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('Invalid value(s) %s, please use one of: %s from enumeration class \EnumType\JP_HotelRoomSizeUnitType', is_array($unit) ? implode(', ', $unit) : var_export($unit, true), 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)
    {
        // validation for constraint: float
        if (!is_null($_) && !(is_float($_) || is_numeric($_))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($_, true), gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
}
