xref: /aosp_15_r20/external/grpc-grpc/examples/php/route_guide/Routeguide/Feature.php (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: route_guide.proto
4
5namespace Routeguide;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * A feature names something at a given point.
13 * If a feature could not be named, the name is empty.
14 *
15 * Generated from protobuf message <code>routeguide.Feature</code>
16 */
17class Feature extends \Google\Protobuf\Internal\Message
18{
19    /**
20     * The name of the feature.
21     *
22     * Generated from protobuf field <code>string name = 1;</code>
23     */
24    protected $name = '';
25    /**
26     * The point where the feature is detected.
27     *
28     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
29     */
30    protected $location = null;
31
32    /**
33     * Constructor.
34     *
35     * @param array $data {
36     *     Optional. Data for populating the Message object.
37     *
38     *     @type string $name
39     *           The name of the feature.
40     *     @type \Routeguide\Point $location
41     *           The point where the feature is detected.
42     * }
43     */
44    public function __construct($data = NULL) {
45        \GPBMetadata\RouteGuide::initOnce();
46        parent::__construct($data);
47    }
48
49    /**
50     * The name of the feature.
51     *
52     * Generated from protobuf field <code>string name = 1;</code>
53     * @return string
54     */
55    public function getName()
56    {
57        return $this->name;
58    }
59
60    /**
61     * The name of the feature.
62     *
63     * Generated from protobuf field <code>string name = 1;</code>
64     * @param string $var
65     * @return $this
66     */
67    public function setName($var)
68    {
69        GPBUtil::checkString($var, True);
70        $this->name = $var;
71
72        return $this;
73    }
74
75    /**
76     * The point where the feature is detected.
77     *
78     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
79     * @return \Routeguide\Point|null
80     */
81    public function getLocation()
82    {
83        return isset($this->location) ? $this->location : null;
84    }
85
86    public function hasLocation()
87    {
88        return isset($this->location);
89    }
90
91    public function clearLocation()
92    {
93        unset($this->location);
94    }
95
96    /**
97     * The point where the feature is detected.
98     *
99     * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
100     * @param \Routeguide\Point $var
101     * @return $this
102     */
103    public function setLocation($var)
104    {
105        GPBUtil::checkMessage($var, \Routeguide\Point::class);
106        $this->location = $var;
107
108        return $this;
109    }
110
111}
112
113