<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OffsetDistance StructType
 * @subpackage Structs
 */
class OffsetDistance extends AbstractStructBase
{
    /**
     * The offsetDistance
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var int
     */
    public $offsetDistance;
    /**
     * The offsetDistanceExtension
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\ExtensionType
     */
    public $offsetDistanceExtension;
    /**
     * Constructor method for OffsetDistance
     * @uses OffsetDistance::setOffsetDistance()
     * @uses OffsetDistance::setOffsetDistanceExtension()
     * @param int $offsetDistance
     * @param \StructType\ExtensionType $offsetDistanceExtension
     */
    public function __construct($offsetDistance = null, \StructType\ExtensionType $offsetDistanceExtension = null)
    {
        $this
            ->setOffsetDistance($offsetDistance)
            ->setOffsetDistanceExtension($offsetDistanceExtension);
    }
    /**
     * Get offsetDistance value
     * @return int
     */
    public function getOffsetDistance()
    {
        return $this->offsetDistance;
    }
    /**
     * Set offsetDistance value
     * @param int $offsetDistance
     * @return \StructType\OffsetDistance
     */
    public function setOffsetDistance($offsetDistance = null)
    {
        // validation for constraint: int
        if (!is_null($offsetDistance) && !is_numeric($offsetDistance)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($offsetDistance)), __LINE__);
        }
        $this->offsetDistance = $offsetDistance;
        return $this;
    }
    /**
     * Get offsetDistanceExtension value
     * @return \StructType\ExtensionType|null
     */
    public function getOffsetDistanceExtension()
    {
        return $this->offsetDistanceExtension;
    }
    /**
     * Set offsetDistanceExtension value
     * @param \StructType\ExtensionType $offsetDistanceExtension
     * @return \StructType\OffsetDistance
     */
    public function setOffsetDistanceExtension(\StructType\ExtensionType $offsetDistanceExtension = null)
    {
        $this->offsetDistanceExtension = $offsetDistanceExtension;
        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\OffsetDistance
     */
    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__;
    }
}
