<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: route_guide.proto

namespace Routeguide;

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

/**
 * A feature names something at a given point.
 * If a feature could not be named, the name is empty.
 *
 * Generated from protobuf message <code>routeguide.Feature</code>
 */
class Feature extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the feature.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * The point where the feature is detected.
     *
     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
     */
    protected $location = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the feature.
     *     @type \Routeguide\Point $location
     *           The point where the feature is detected.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\RouteGuide::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the feature.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

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

        return $this;
    }

    /**
     * The point where the feature is detected.
     *
     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
     * @return \Routeguide\Point|null
     */
    public function getLocation()
    {
        return isset($this->location) ? $this->location : null;
    }

    public function hasLocation()
    {
        return isset($this->location);
    }

    public function clearLocation()
    {
        unset($this->location);
    }

    /**
     * The point where the feature is detected.
     *
     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
     * @param \Routeguide\Point $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkMessage($var, \Routeguide\Point::class);
        $this->location = $var;

        return $this;
    }

}