<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: couchbase/search/v1/search.proto

namespace Couchbase\Protostellar\Generated\Search\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Generated from protobuf message <code>couchbase.search.v1.MatchQuery</code>
 */
class MatchQuery extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional float boost = 1;</code>
     */
    protected $boost = null;
    /**
     * Generated from protobuf field <code>optional string field = 2;</code>
     */
    protected $field = null;
    /**
     * Generated from protobuf field <code>string value = 3;</code>
     */
    protected $value = '';
    /**
     * Generated from protobuf field <code>optional string analyzer = 4;</code>
     */
    protected $analyzer = null;
    /**
     * Generated from protobuf field <code>optional uint64 fuzziness = 5;</code>
     */
    protected $fuzziness = null;
    /**
     * Generated from protobuf field <code>optional .couchbase.search.v1.MatchQuery.Operator operator = 6;</code>
     */
    protected $operator = null;
    /**
     * Generated from protobuf field <code>optional uint64 prefix_length = 7;</code>
     */
    protected $prefix_length = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $boost
     *     @type string $field
     *     @type string $value
     *     @type string $analyzer
     *     @type int|string $fuzziness
     *     @type int $operator
     *     @type int|string $prefix_length
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Search\V1\Search::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional float boost = 1;</code>
     * @return float
     */
    public function getBoost()
    {
        return isset($this->boost) ? $this->boost : 0.0;
    }

    public function hasBoost()
    {
        return isset($this->boost);
    }

    public function clearBoost()
    {
        unset($this->boost);
    }

    /**
     * Generated from protobuf field <code>optional float boost = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setBoost($var)
    {
        GPBUtil::checkFloat($var);
        $this->boost = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string field = 2;</code>
     * @return string
     */
    public function getField()
    {
        return isset($this->field) ? $this->field : '';
    }

    public function hasField()
    {
        return isset($this->field);
    }

    public function clearField()
    {
        unset($this->field);
    }

    /**
     * Generated from protobuf field <code>optional string field = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setField($var)
    {
        GPBUtil::checkString($var, True);
        $this->field = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string value = 3;</code>
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Generated from protobuf field <code>string value = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->value = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string analyzer = 4;</code>
     * @return string
     */
    public function getAnalyzer()
    {
        return isset($this->analyzer) ? $this->analyzer : '';
    }

    public function hasAnalyzer()
    {
        return isset($this->analyzer);
    }

    public function clearAnalyzer()
    {
        unset($this->analyzer);
    }

    /**
     * Generated from protobuf field <code>optional string analyzer = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAnalyzer($var)
    {
        GPBUtil::checkString($var, True);
        $this->analyzer = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint64 fuzziness = 5;</code>
     * @return int|string
     */
    public function getFuzziness()
    {
        return isset($this->fuzziness) ? $this->fuzziness : 0;
    }

    public function hasFuzziness()
    {
        return isset($this->fuzziness);
    }

    public function clearFuzziness()
    {
        unset($this->fuzziness);
    }

    /**
     * Generated from protobuf field <code>optional uint64 fuzziness = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setFuzziness($var)
    {
        GPBUtil::checkUint64($var);
        $this->fuzziness = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.search.v1.MatchQuery.Operator operator = 6;</code>
     * @return int
     */
    public function getOperator()
    {
        return isset($this->operator) ? $this->operator : 0;
    }

    public function hasOperator()
    {
        return isset($this->operator);
    }

    public function clearOperator()
    {
        unset($this->operator);
    }

    /**
     * Generated from protobuf field <code>optional .couchbase.search.v1.MatchQuery.Operator operator = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setOperator($var)
    {
        GPBUtil::checkEnum($var, \Couchbase\Protostellar\Generated\Search\V1\MatchQuery\Operator::class);
        $this->operator = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint64 prefix_length = 7;</code>
     * @return int|string
     */
    public function getPrefixLength()
    {
        return isset($this->prefix_length) ? $this->prefix_length : 0;
    }

    public function hasPrefixLength()
    {
        return isset($this->prefix_length);
    }

    public function clearPrefixLength()
    {
        unset($this->prefix_length);
    }

    /**
     * Generated from protobuf field <code>optional uint64 prefix_length = 7;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPrefixLength($var)
    {
        GPBUtil::checkUint64($var);
        $this->prefix_length = $var;

        return $this;
    }

}

