<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for InsCoverageDetailTypeTotalTripQuantity StructType
 * @package Dg
 * @subpackage Structs
 */
class DgInsCoverageDetailTypeTotalTripQuantity extends AbstractStructBase
{
    /**
     * The Quantity
     * @var int
     */
    public $Quantity;
    /**
     * Constructor method for InsCoverageDetailTypeTotalTripQuantity
     * @uses DgInsCoverageDetailTypeTotalTripQuantity::setQuantity()
     * @param int $quantity
     */
    public function __construct($quantity = null)
    {
        $this
            ->setQuantity($quantity);
    }
    /**
     * Get Quantity value
     * @return int|null
     */
    public function getQuantity()
    {
        return $this->Quantity;
    }
    /**
     * Set Quantity value
     * @param int $quantity
     * @return \dgsoft\StructType\DgInsCoverageDetailTypeTotalTripQuantity
     */
    public function setQuantity($quantity = null)
    {
        // validation for constraint: int
        if (!is_null($quantity) && !is_numeric($quantity)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantity)), __LINE__);
        }
        $this->Quantity = $quantity;
        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\DgInsCoverageDetailTypeTotalTripQuantity
     */
    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__;
    }
}
