<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SearchValueMatch StructType
 * @package Dg
 * @subpackage Structs
 */
class DgSearchValueMatch extends AbstractStructBase
{
    /**
     * The Match
     * Meta informations extracted from the WSDL
     * - use: required
     * @var bool
     */
    public $Match;
    /**
     * The _
     * @var string
     */
    public $_;
    /**
     * The Relevance
     * @var float
     */
    public $Relevance;
    /**
     * Constructor method for SearchValueMatch
     * @uses DgSearchValueMatch::setMatch()
     * @uses DgSearchValueMatch::set_()
     * @uses DgSearchValueMatch::setRelevance()
     * @param bool $match
     * @param string $_
     * @param float $relevance
     */
    public function __construct($match = null, $_ = null, $relevance = null)
    {
        $this
            ->setMatch($match)
            ->set_($_)
            ->setRelevance($relevance);
    }
    /**
     * Get Match value
     * @return bool
     */
    public function getMatch()
    {
        return $this->Match;
    }
    /**
     * Set Match value
     * @param bool $match
     * @return \dgsoft\StructType\DgSearchValueMatch
     */
    public function setMatch($match = null)
    {
        // validation for constraint: boolean
        if (!is_null($match) && !is_bool($match)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($match)), __LINE__);
        }
        $this->Match = $match;
        return $this;
    }
    /**
     * Get _ value
     * @return string|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param string $_
     * @return \dgsoft\StructType\DgSearchValueMatch
     */
    public function set_($_ = null)
    {
        // validation for constraint: string
        if (!is_null($_) && !is_string($_)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
    /**
     * Get Relevance value
     * @return float|null
     */
    public function getRelevance()
    {
        return $this->Relevance;
    }
    /**
     * Set Relevance value
     * @param float $relevance
     * @return \dgsoft\StructType\DgSearchValueMatch
     */
    public function setRelevance($relevance = null)
    {
        $this->Relevance = $relevance;
        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\DgSearchValueMatch
     */
    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__;
    }
}
