<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for KeyValuePairOfintFailureInformationWTEG5wMr StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:KeyValuePairOfintFailureInformationWTEG5wMr
 * @subpackage Structs
 */
class KeyValuePairOfintFailureInformationWTEG5wMr extends AbstractStructBase
{
    /**
     * The key
     * @var int
     */
    public $key;
    /**
     * The value
     * Meta information extracted from the WSDL
     * - nillable: true
     * @var \patest\StructType\FailureInformation
     */
    public $value;
    /**
     * Constructor method for KeyValuePairOfintFailureInformationWTEG5wMr
     * @uses KeyValuePairOfintFailureInformationWTEG5wMr::setKey()
     * @uses KeyValuePairOfintFailureInformationWTEG5wMr::setValue()
     * @param int $key
     * @param \patest\StructType\FailureInformation $value
     */
    public function __construct($key = null, \patest\StructType\FailureInformation $value = null)
    {
        $this
            ->setKey($key)
            ->setValue($value);
    }
    /**
     * Get key value
     * @return int|null
     */
    public function getKey()
    {
        return $this->key;
    }
    /**
     * Set key value
     * @param int $key
     * @return \patest\StructType\KeyValuePairOfintFailureInformationWTEG5wMr
     */
    public function setKey($key = null)
    {
        // validation for constraint: int
        if (!is_null($key) && !(is_int($key) || ctype_digit($key))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($key, true), gettype($key)), __LINE__);
        }
        $this->key = $key;
        return $this;
    }
    /**
     * Get value value
     * @return \patest\StructType\FailureInformation|null
     */
    public function getValue()
    {
        return $this->value;
    }
    /**
     * Set value value
     * @param \patest\StructType\FailureInformation $value
     * @return \patest\StructType\KeyValuePairOfintFailureInformationWTEG5wMr
     */
    public function setValue(\patest\StructType\FailureInformation $value = null)
    {
        $this->value = $value;
        return $this;
    }
}
