<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/feature_online_store_service.proto

namespace Google\Cloud\AIPlatform\V1\NearestNeighborQuery;

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

/**
 * Numeric filter is used to search a subset of the entities by using boolean
 * rules on numeric columns.
 * For example:
 * Database Point 0: {name: "a" value_int: 42} {name: "b" value_float: 1.0}
 * Database Point 1:  {name: "a" value_int: 10} {name: "b" value_float: 2.0}
 * Database Point 2: {name: "a" value_int: -1} {name: "b" value_float: 3.0}
 * Query: {name: "a" value_int: 12 operator: LESS}    // Matches Point 1, 2
 * {name: "b" value_float: 2.0 operator: EQUAL} // Matches Point 1
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter</code>
 */
class NumericFilter extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Column name in BigQuery that used as filters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $name = '';
    /**
     * Optional. This MUST be specified for queries and must NOT be specified
     * for database points.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.Operator op = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $op = null;
    protected $Value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $value_int
     *           int value type.
     *     @type float $value_float
     *           float value type.
     *     @type float $value_double
     *           double value type.
     *     @type string $name
     *           Required. Column name in BigQuery that used as filters.
     *     @type int $op
     *           Optional. This MUST be specified for queries and must NOT be specified
     *           for database points.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\FeatureOnlineStoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * int value type.
     *
     * Generated from protobuf field <code>int64 value_int = 2;</code>
     * @return int|string
     */
    public function getValueInt()
    {
        return $this->readOneof(2);
    }

    public function hasValueInt()
    {
        return $this->hasOneof(2);
    }

    /**
     * int value type.
     *
     * Generated from protobuf field <code>int64 value_int = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setValueInt($var)
    {
        GPBUtil::checkInt64($var);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * float value type.
     *
     * Generated from protobuf field <code>float value_float = 3;</code>
     * @return float
     */
    public function getValueFloat()
    {
        return $this->readOneof(3);
    }

    public function hasValueFloat()
    {
        return $this->hasOneof(3);
    }

    /**
     * float value type.
     *
     * Generated from protobuf field <code>float value_float = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setValueFloat($var)
    {
        GPBUtil::checkFloat($var);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * double value type.
     *
     * Generated from protobuf field <code>double value_double = 4;</code>
     * @return float
     */
    public function getValueDouble()
    {
        return $this->readOneof(4);
    }

    public function hasValueDouble()
    {
        return $this->hasOneof(4);
    }

    /**
     * double value type.
     *
     * Generated from protobuf field <code>double value_double = 4;</code>
     * @param float $var
     * @return $this
     */
    public function setValueDouble($var)
    {
        GPBUtil::checkDouble($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Required. Column name in BigQuery that used as filters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Column name in BigQuery that used as filters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. This MUST be specified for queries and must NOT be specified
     * for database points.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.Operator op = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getOp()
    {
        return isset($this->op) ? $this->op : 0;
    }

    public function hasOp()
    {
        return isset($this->op);
    }

    public function clearOp()
    {
        unset($this->op);
    }

    /**
     * Optional. This MUST be specified for queries and must NOT be specified
     * for database points.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.Operator op = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setOp($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\NearestNeighborQuery\NumericFilter\Operator::class);
        $this->op = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getValue()
    {
        return $this->whichOneof("Value");
    }

}


