<?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\NearestNeighbors;

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

/**
 * A neighbor of the query vector.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.NearestNeighbors.Neighbor</code>
 */
class Neighbor extends \Google\Protobuf\Internal\Message
{
    /**
     * The id of the similar entity.
     *
     * Generated from protobuf field <code>string entity_id = 1;</code>
     */
    protected $entity_id = '';
    /**
     * The distance between the neighbor and the query vector.
     *
     * Generated from protobuf field <code>double distance = 2;</code>
     */
    protected $distance = 0.0;
    /**
     * The attributes of the neighbor, e.g. filters, crowding and metadata
     * Note that full entities are returned only when "return_full_entity"
     * is set to true. Otherwise, only the "entity_id" and "distance" fields
     * are populated.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FetchFeatureValuesResponse entity_key_values = 3;</code>
     */
    protected $entity_key_values = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $entity_id
     *           The id of the similar entity.
     *     @type float $distance
     *           The distance between the neighbor and the query vector.
     *     @type \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse $entity_key_values
     *           The attributes of the neighbor, e.g. filters, crowding and metadata
     *           Note that full entities are returned only when "return_full_entity"
     *           is set to true. Otherwise, only the "entity_id" and "distance" fields
     *           are populated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\FeatureOnlineStoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * The id of the similar entity.
     *
     * Generated from protobuf field <code>string entity_id = 1;</code>
     * @return string
     */
    public function getEntityId()
    {
        return $this->entity_id;
    }

    /**
     * The id of the similar entity.
     *
     * Generated from protobuf field <code>string entity_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setEntityId($var)
    {
        GPBUtil::checkString($var, True);
        $this->entity_id = $var;

        return $this;
    }

    /**
     * The distance between the neighbor and the query vector.
     *
     * Generated from protobuf field <code>double distance = 2;</code>
     * @return float
     */
    public function getDistance()
    {
        return $this->distance;
    }

    /**
     * The distance between the neighbor and the query vector.
     *
     * Generated from protobuf field <code>double distance = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setDistance($var)
    {
        GPBUtil::checkDouble($var);
        $this->distance = $var;

        return $this;
    }

    /**
     * The attributes of the neighbor, e.g. filters, crowding and metadata
     * Note that full entities are returned only when "return_full_entity"
     * is set to true. Otherwise, only the "entity_id" and "distance" fields
     * are populated.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FetchFeatureValuesResponse entity_key_values = 3;</code>
     * @return \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse|null
     */
    public function getEntityKeyValues()
    {
        return $this->entity_key_values;
    }

    public function hasEntityKeyValues()
    {
        return isset($this->entity_key_values);
    }

    public function clearEntityKeyValues()
    {
        unset($this->entity_key_values);
    }

    /**
     * The attributes of the neighbor, e.g. filters, crowding and metadata
     * Note that full entities are returned only when "return_full_entity"
     * is set to true. Otherwise, only the "entity_id" and "distance" fields
     * are populated.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FetchFeatureValuesResponse entity_key_values = 3;</code>
     * @param \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse $var
     * @return $this
     */
    public function setEntityKeyValues($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse::class);
        $this->entity_key_values = $var;

        return $this;
    }

}


