<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VoluntaryChangesType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgVoluntaryChangesType extends AbstractStructBase
{
    /**
     * The Penalty
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgPenalty
     */
    public $Penalty;
    /**
     * The VolChangeInd
     * @var bool
     */
    public $VolChangeInd;
    /**
     * Constructor method for VoluntaryChangesType
     * @uses DgVoluntaryChangesType::setPenalty()
     * @uses DgVoluntaryChangesType::setVolChangeInd()
     * @param \dgsoft\StructType\DgPenalty $penalty
     * @param bool $volChangeInd
     */
    public function __construct(\dgsoft\StructType\DgPenalty $penalty = null, $volChangeInd = null)
    {
        $this
            ->setPenalty($penalty)
            ->setVolChangeInd($volChangeInd);
    }
    /**
     * Get Penalty value
     * @return \dgsoft\StructType\DgPenalty|null
     */
    public function getPenalty()
    {
        return $this->Penalty;
    }
    /**
     * Set Penalty value
     * @param \dgsoft\StructType\DgPenalty $penalty
     * @return \dgsoft\StructType\DgVoluntaryChangesType
     */
    public function setPenalty(\dgsoft\StructType\DgPenalty $penalty = null)
    {
        $this->Penalty = $penalty;
        return $this;
    }
    /**
     * Get VolChangeInd value
     * @return bool|null
     */
    public function getVolChangeInd()
    {
        return $this->VolChangeInd;
    }
    /**
     * Set VolChangeInd value
     * @param bool $volChangeInd
     * @return \dgsoft\StructType\DgVoluntaryChangesType
     */
    public function setVolChangeInd($volChangeInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($volChangeInd) && !is_bool($volChangeInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($volChangeInd)), __LINE__);
        }
        $this->VolChangeInd = $volChangeInd;
        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\DgVoluntaryChangesType
     */
    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__;
    }
}
