OLD | NEW |
(Empty) | |
| 1 <?php |
| 2 # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 # source: google/protobuf/descriptor.proto |
| 4 |
| 5 namespace Google\Protobuf\Internal; |
| 6 |
| 7 use Google\Protobuf\Internal\GPBType; |
| 8 use Google\Protobuf\Internal\GPBWire; |
| 9 use Google\Protobuf\Internal\RepeatedField; |
| 10 use Google\Protobuf\Internal\InputStream; |
| 11 |
| 12 use Google\Protobuf\Internal\GPBUtil; |
| 13 |
| 14 /** |
| 15 * <pre> |
| 16 * Describes a field within a message. |
| 17 * </pre> |
| 18 * |
| 19 * Protobuf type <code>google.protobuf.FieldDescriptorProto</code> |
| 20 */ |
| 21 class FieldDescriptorProto extends \Google\Protobuf\Internal\Message |
| 22 { |
| 23 /** |
| 24 * <code>optional string name = 1;</code> |
| 25 */ |
| 26 private $name = ''; |
| 27 private $has_name = false; |
| 28 /** |
| 29 * <code>optional int32 number = 3;</code> |
| 30 */ |
| 31 private $number = 0; |
| 32 private $has_number = false; |
| 33 /** |
| 34 * <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</co
de> |
| 35 */ |
| 36 private $label = 0; |
| 37 private $has_label = false; |
| 38 /** |
| 39 * <pre> |
| 40 * If type_name is set, this need not be set. If both this and type_name |
| 41 * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. |
| 42 * </pre> |
| 43 * |
| 44 * <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code
> |
| 45 */ |
| 46 private $type = 0; |
| 47 private $has_type = false; |
| 48 /** |
| 49 * <pre> |
| 50 * For message and enum types, this is the name of the type. If the name |
| 51 * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping |
| 52 * rules are used to find the type (i.e. first the nested types within this |
| 53 * message are searched, then within the parent, on up to the root |
| 54 * namespace). |
| 55 * </pre> |
| 56 * |
| 57 * <code>optional string type_name = 6;</code> |
| 58 */ |
| 59 private $type_name = ''; |
| 60 private $has_type_name = false; |
| 61 /** |
| 62 * <pre> |
| 63 * For extensions, this is the name of the type being extended. It is |
| 64 * resolved in the same manner as type_name. |
| 65 * </pre> |
| 66 * |
| 67 * <code>optional string extendee = 2;</code> |
| 68 */ |
| 69 private $extendee = ''; |
| 70 private $has_extendee = false; |
| 71 /** |
| 72 * <pre> |
| 73 * For numeric types, contains the original text representation of the value
. |
| 74 * For booleans, "true" or "false". |
| 75 * For strings, contains the default text contents (not escaped in any way). |
| 76 * For bytes, contains the C escaped value. All bytes >= 128 are escaped
. |
| 77 * TODO(kenton): Base-64 encode? |
| 78 * </pre> |
| 79 * |
| 80 * <code>optional string default_value = 7;</code> |
| 81 */ |
| 82 private $default_value = ''; |
| 83 private $has_default_value = false; |
| 84 /** |
| 85 * <pre> |
| 86 * If set, gives the index of a oneof in the containing type's oneof_decl |
| 87 * list. This field is a member of that oneof. |
| 88 * </pre> |
| 89 * |
| 90 * <code>optional int32 oneof_index = 9;</code> |
| 91 */ |
| 92 private $oneof_index = 0; |
| 93 private $has_oneof_index = false; |
| 94 /** |
| 95 * <pre> |
| 96 * JSON name of this field. The value is set by protocol compiler. If the |
| 97 * user has set a "json_name" option on this field, that option's value |
| 98 * will be used. Otherwise, it's deduced from the field's name by converting |
| 99 * it to camelCase. |
| 100 * </pre> |
| 101 * |
| 102 * <code>optional string json_name = 10;</code> |
| 103 */ |
| 104 private $json_name = ''; |
| 105 private $has_json_name = false; |
| 106 /** |
| 107 * <code>optional .google.protobuf.FieldOptions options = 8;</code> |
| 108 */ |
| 109 private $options = null; |
| 110 private $has_options = false; |
| 111 |
| 112 public function __construct() { |
| 113 \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
| 114 parent::__construct(); |
| 115 } |
| 116 |
| 117 /** |
| 118 * <code>optional string name = 1;</code> |
| 119 */ |
| 120 public function getName() |
| 121 { |
| 122 return $this->name; |
| 123 } |
| 124 |
| 125 /** |
| 126 * <code>optional string name = 1;</code> |
| 127 */ |
| 128 public function setName($var) |
| 129 { |
| 130 GPBUtil::checkString($var, True); |
| 131 $this->name = $var; |
| 132 $this->has_name = true; |
| 133 } |
| 134 |
| 135 public function hasName() |
| 136 { |
| 137 return $this->has_name; |
| 138 } |
| 139 |
| 140 /** |
| 141 * <code>optional int32 number = 3;</code> |
| 142 */ |
| 143 public function getNumber() |
| 144 { |
| 145 return $this->number; |
| 146 } |
| 147 |
| 148 /** |
| 149 * <code>optional int32 number = 3;</code> |
| 150 */ |
| 151 public function setNumber($var) |
| 152 { |
| 153 GPBUtil::checkInt32($var); |
| 154 $this->number = $var; |
| 155 $this->has_number = true; |
| 156 } |
| 157 |
| 158 public function hasNumber() |
| 159 { |
| 160 return $this->has_number; |
| 161 } |
| 162 |
| 163 /** |
| 164 * <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</co
de> |
| 165 */ |
| 166 public function getLabel() |
| 167 { |
| 168 return $this->label; |
| 169 } |
| 170 |
| 171 /** |
| 172 * <code>optional .google.protobuf.FieldDescriptorProto.Label label = 4;</co
de> |
| 173 */ |
| 174 public function setLabel($var) |
| 175 { |
| 176 GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto_
Label::class); |
| 177 $this->label = $var; |
| 178 $this->has_label = true; |
| 179 } |
| 180 |
| 181 public function hasLabel() |
| 182 { |
| 183 return $this->has_label; |
| 184 } |
| 185 |
| 186 /** |
| 187 * <pre> |
| 188 * If type_name is set, this need not be set. If both this and type_name |
| 189 * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. |
| 190 * </pre> |
| 191 * |
| 192 * <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code
> |
| 193 */ |
| 194 public function getType() |
| 195 { |
| 196 return $this->type; |
| 197 } |
| 198 |
| 199 /** |
| 200 * <pre> |
| 201 * If type_name is set, this need not be set. If both this and type_name |
| 202 * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. |
| 203 * </pre> |
| 204 * |
| 205 * <code>optional .google.protobuf.FieldDescriptorProto.Type type = 5;</code
> |
| 206 */ |
| 207 public function setType($var) |
| 208 { |
| 209 GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto_
Type::class); |
| 210 $this->type = $var; |
| 211 $this->has_type = true; |
| 212 } |
| 213 |
| 214 public function hasType() |
| 215 { |
| 216 return $this->has_type; |
| 217 } |
| 218 |
| 219 /** |
| 220 * <pre> |
| 221 * For message and enum types, this is the name of the type. If the name |
| 222 * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping |
| 223 * rules are used to find the type (i.e. first the nested types within this |
| 224 * message are searched, then within the parent, on up to the root |
| 225 * namespace). |
| 226 * </pre> |
| 227 * |
| 228 * <code>optional string type_name = 6;</code> |
| 229 */ |
| 230 public function getTypeName() |
| 231 { |
| 232 return $this->type_name; |
| 233 } |
| 234 |
| 235 /** |
| 236 * <pre> |
| 237 * For message and enum types, this is the name of the type. If the name |
| 238 * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping |
| 239 * rules are used to find the type (i.e. first the nested types within this |
| 240 * message are searched, then within the parent, on up to the root |
| 241 * namespace). |
| 242 * </pre> |
| 243 * |
| 244 * <code>optional string type_name = 6;</code> |
| 245 */ |
| 246 public function setTypeName($var) |
| 247 { |
| 248 GPBUtil::checkString($var, True); |
| 249 $this->type_name = $var; |
| 250 $this->has_type_name = true; |
| 251 } |
| 252 |
| 253 public function hasTypeName() |
| 254 { |
| 255 return $this->has_type_name; |
| 256 } |
| 257 |
| 258 /** |
| 259 * <pre> |
| 260 * For extensions, this is the name of the type being extended. It is |
| 261 * resolved in the same manner as type_name. |
| 262 * </pre> |
| 263 * |
| 264 * <code>optional string extendee = 2;</code> |
| 265 */ |
| 266 public function getExtendee() |
| 267 { |
| 268 return $this->extendee; |
| 269 } |
| 270 |
| 271 /** |
| 272 * <pre> |
| 273 * For extensions, this is the name of the type being extended. It is |
| 274 * resolved in the same manner as type_name. |
| 275 * </pre> |
| 276 * |
| 277 * <code>optional string extendee = 2;</code> |
| 278 */ |
| 279 public function setExtendee($var) |
| 280 { |
| 281 GPBUtil::checkString($var, True); |
| 282 $this->extendee = $var; |
| 283 $this->has_extendee = true; |
| 284 } |
| 285 |
| 286 public function hasExtendee() |
| 287 { |
| 288 return $this->has_extendee; |
| 289 } |
| 290 |
| 291 /** |
| 292 * <pre> |
| 293 * For numeric types, contains the original text representation of the value
. |
| 294 * For booleans, "true" or "false". |
| 295 * For strings, contains the default text contents (not escaped in any way). |
| 296 * For bytes, contains the C escaped value. All bytes >= 128 are escaped
. |
| 297 * TODO(kenton): Base-64 encode? |
| 298 * </pre> |
| 299 * |
| 300 * <code>optional string default_value = 7;</code> |
| 301 */ |
| 302 public function getDefaultValue() |
| 303 { |
| 304 return $this->default_value; |
| 305 } |
| 306 |
| 307 /** |
| 308 * <pre> |
| 309 * For numeric types, contains the original text representation of the value
. |
| 310 * For booleans, "true" or "false". |
| 311 * For strings, contains the default text contents (not escaped in any way). |
| 312 * For bytes, contains the C escaped value. All bytes >= 128 are escaped
. |
| 313 * TODO(kenton): Base-64 encode? |
| 314 * </pre> |
| 315 * |
| 316 * <code>optional string default_value = 7;</code> |
| 317 */ |
| 318 public function setDefaultValue($var) |
| 319 { |
| 320 GPBUtil::checkString($var, True); |
| 321 $this->default_value = $var; |
| 322 $this->has_default_value = true; |
| 323 } |
| 324 |
| 325 public function hasDefaultValue() |
| 326 { |
| 327 return $this->has_default_value; |
| 328 } |
| 329 |
| 330 /** |
| 331 * <pre> |
| 332 * If set, gives the index of a oneof in the containing type's oneof_decl |
| 333 * list. This field is a member of that oneof. |
| 334 * </pre> |
| 335 * |
| 336 * <code>optional int32 oneof_index = 9;</code> |
| 337 */ |
| 338 public function getOneofIndex() |
| 339 { |
| 340 return $this->oneof_index; |
| 341 } |
| 342 |
| 343 /** |
| 344 * <pre> |
| 345 * If set, gives the index of a oneof in the containing type's oneof_decl |
| 346 * list. This field is a member of that oneof. |
| 347 * </pre> |
| 348 * |
| 349 * <code>optional int32 oneof_index = 9;</code> |
| 350 */ |
| 351 public function setOneofIndex($var) |
| 352 { |
| 353 GPBUtil::checkInt32($var); |
| 354 $this->oneof_index = $var; |
| 355 $this->has_oneof_index = true; |
| 356 } |
| 357 |
| 358 public function hasOneofIndex() |
| 359 { |
| 360 return $this->has_oneof_index; |
| 361 } |
| 362 |
| 363 /** |
| 364 * <pre> |
| 365 * JSON name of this field. The value is set by protocol compiler. If the |
| 366 * user has set a "json_name" option on this field, that option's value |
| 367 * will be used. Otherwise, it's deduced from the field's name by converting |
| 368 * it to camelCase. |
| 369 * </pre> |
| 370 * |
| 371 * <code>optional string json_name = 10;</code> |
| 372 */ |
| 373 public function getJsonName() |
| 374 { |
| 375 return $this->json_name; |
| 376 } |
| 377 |
| 378 /** |
| 379 * <pre> |
| 380 * JSON name of this field. The value is set by protocol compiler. If the |
| 381 * user has set a "json_name" option on this field, that option's value |
| 382 * will be used. Otherwise, it's deduced from the field's name by converting |
| 383 * it to camelCase. |
| 384 * </pre> |
| 385 * |
| 386 * <code>optional string json_name = 10;</code> |
| 387 */ |
| 388 public function setJsonName($var) |
| 389 { |
| 390 GPBUtil::checkString($var, True); |
| 391 $this->json_name = $var; |
| 392 $this->has_json_name = true; |
| 393 } |
| 394 |
| 395 public function hasJsonName() |
| 396 { |
| 397 return $this->has_json_name; |
| 398 } |
| 399 |
| 400 /** |
| 401 * <code>optional .google.protobuf.FieldOptions options = 8;</code> |
| 402 */ |
| 403 public function getOptions() |
| 404 { |
| 405 return $this->options; |
| 406 } |
| 407 |
| 408 /** |
| 409 * <code>optional .google.protobuf.FieldOptions options = 8;</code> |
| 410 */ |
| 411 public function setOptions(&$var) |
| 412 { |
| 413 GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::clas
s); |
| 414 $this->options = $var; |
| 415 $this->has_options = true; |
| 416 } |
| 417 |
| 418 public function hasOptions() |
| 419 { |
| 420 return $this->has_options; |
| 421 } |
| 422 |
| 423 } |
| 424 |
OLD | NEW |