1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/iot/v1/device_manager.proto 18 19 package com.google.cloud.iot.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Response for `ListDeviceStates`. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesResponse} 29 */ 30 public final class ListDeviceStatesResponse extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.ListDeviceStatesResponse) 33 ListDeviceStatesResponseOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use ListDeviceStatesResponse.newBuilder() to construct. ListDeviceStatesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private ListDeviceStatesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 ListDeviceStatesResponse()40 private ListDeviceStatesResponse() { 41 deviceStates_ = java.util.Collections.emptyList(); 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new ListDeviceStatesResponse(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.iot.v1.DeviceManagerProto 57 .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.iot.v1.DeviceManagerProto 64 .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.iot.v1.ListDeviceStatesResponse.class, 67 com.google.cloud.iot.v1.ListDeviceStatesResponse.Builder.class); 68 } 69 70 public static final int DEVICE_STATES_FIELD_NUMBER = 1; 71 72 @SuppressWarnings("serial") 73 private java.util.List<com.google.cloud.iot.v1.DeviceState> deviceStates_; 74 /** 75 * 76 * 77 * <pre> 78 * The last few device states. States are listed in descending order of server 79 * update time, starting from the most recent one. 80 * </pre> 81 * 82 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 83 */ 84 @java.lang.Override getDeviceStatesList()85 public java.util.List<com.google.cloud.iot.v1.DeviceState> getDeviceStatesList() { 86 return deviceStates_; 87 } 88 /** 89 * 90 * 91 * <pre> 92 * The last few device states. States are listed in descending order of server 93 * update time, starting from the most recent one. 94 * </pre> 95 * 96 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 97 */ 98 @java.lang.Override 99 public java.util.List<? extends com.google.cloud.iot.v1.DeviceStateOrBuilder> getDeviceStatesOrBuilderList()100 getDeviceStatesOrBuilderList() { 101 return deviceStates_; 102 } 103 /** 104 * 105 * 106 * <pre> 107 * The last few device states. States are listed in descending order of server 108 * update time, starting from the most recent one. 109 * </pre> 110 * 111 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 112 */ 113 @java.lang.Override getDeviceStatesCount()114 public int getDeviceStatesCount() { 115 return deviceStates_.size(); 116 } 117 /** 118 * 119 * 120 * <pre> 121 * The last few device states. States are listed in descending order of server 122 * update time, starting from the most recent one. 123 * </pre> 124 * 125 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 126 */ 127 @java.lang.Override getDeviceStates(int index)128 public com.google.cloud.iot.v1.DeviceState getDeviceStates(int index) { 129 return deviceStates_.get(index); 130 } 131 /** 132 * 133 * 134 * <pre> 135 * The last few device states. States are listed in descending order of server 136 * update time, starting from the most recent one. 137 * </pre> 138 * 139 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 140 */ 141 @java.lang.Override getDeviceStatesOrBuilder(int index)142 public com.google.cloud.iot.v1.DeviceStateOrBuilder getDeviceStatesOrBuilder(int index) { 143 return deviceStates_.get(index); 144 } 145 146 private byte memoizedIsInitialized = -1; 147 148 @java.lang.Override isInitialized()149 public final boolean isInitialized() { 150 byte isInitialized = memoizedIsInitialized; 151 if (isInitialized == 1) return true; 152 if (isInitialized == 0) return false; 153 154 memoizedIsInitialized = 1; 155 return true; 156 } 157 158 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)159 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 160 for (int i = 0; i < deviceStates_.size(); i++) { 161 output.writeMessage(1, deviceStates_.get(i)); 162 } 163 getUnknownFields().writeTo(output); 164 } 165 166 @java.lang.Override getSerializedSize()167 public int getSerializedSize() { 168 int size = memoizedSize; 169 if (size != -1) return size; 170 171 size = 0; 172 for (int i = 0; i < deviceStates_.size(); i++) { 173 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, deviceStates_.get(i)); 174 } 175 size += getUnknownFields().getSerializedSize(); 176 memoizedSize = size; 177 return size; 178 } 179 180 @java.lang.Override equals(final java.lang.Object obj)181 public boolean equals(final java.lang.Object obj) { 182 if (obj == this) { 183 return true; 184 } 185 if (!(obj instanceof com.google.cloud.iot.v1.ListDeviceStatesResponse)) { 186 return super.equals(obj); 187 } 188 com.google.cloud.iot.v1.ListDeviceStatesResponse other = 189 (com.google.cloud.iot.v1.ListDeviceStatesResponse) obj; 190 191 if (!getDeviceStatesList().equals(other.getDeviceStatesList())) return false; 192 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 193 return true; 194 } 195 196 @java.lang.Override hashCode()197 public int hashCode() { 198 if (memoizedHashCode != 0) { 199 return memoizedHashCode; 200 } 201 int hash = 41; 202 hash = (19 * hash) + getDescriptor().hashCode(); 203 if (getDeviceStatesCount() > 0) { 204 hash = (37 * hash) + DEVICE_STATES_FIELD_NUMBER; 205 hash = (53 * hash) + getDeviceStatesList().hashCode(); 206 } 207 hash = (29 * hash) + getUnknownFields().hashCode(); 208 memoizedHashCode = hash; 209 return hash; 210 } 211 parseFrom(java.nio.ByteBuffer data)212 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom(java.nio.ByteBuffer data) 213 throws com.google.protobuf.InvalidProtocolBufferException { 214 return PARSER.parseFrom(data); 215 } 216 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)217 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 218 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 219 throws com.google.protobuf.InvalidProtocolBufferException { 220 return PARSER.parseFrom(data, extensionRegistry); 221 } 222 parseFrom( com.google.protobuf.ByteString data)223 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 224 com.google.protobuf.ByteString data) 225 throws com.google.protobuf.InvalidProtocolBufferException { 226 return PARSER.parseFrom(data); 227 } 228 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)229 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 230 com.google.protobuf.ByteString data, 231 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 232 throws com.google.protobuf.InvalidProtocolBufferException { 233 return PARSER.parseFrom(data, extensionRegistry); 234 } 235 parseFrom(byte[] data)236 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom(byte[] data) 237 throws com.google.protobuf.InvalidProtocolBufferException { 238 return PARSER.parseFrom(data); 239 } 240 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)241 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 242 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 243 throws com.google.protobuf.InvalidProtocolBufferException { 244 return PARSER.parseFrom(data, extensionRegistry); 245 } 246 parseFrom( java.io.InputStream input)247 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 248 java.io.InputStream input) throws java.io.IOException { 249 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 250 } 251 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)252 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 253 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 254 throws java.io.IOException { 255 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 256 PARSER, input, extensionRegistry); 257 } 258 parseDelimitedFrom( java.io.InputStream input)259 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseDelimitedFrom( 260 java.io.InputStream input) throws java.io.IOException { 261 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 262 } 263 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)264 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseDelimitedFrom( 265 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 266 throws java.io.IOException { 267 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 268 PARSER, input, extensionRegistry); 269 } 270 parseFrom( com.google.protobuf.CodedInputStream input)271 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 272 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 273 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 274 } 275 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)276 public static com.google.cloud.iot.v1.ListDeviceStatesResponse parseFrom( 277 com.google.protobuf.CodedInputStream input, 278 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 279 throws java.io.IOException { 280 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 281 PARSER, input, extensionRegistry); 282 } 283 284 @java.lang.Override newBuilderForType()285 public Builder newBuilderForType() { 286 return newBuilder(); 287 } 288 newBuilder()289 public static Builder newBuilder() { 290 return DEFAULT_INSTANCE.toBuilder(); 291 } 292 newBuilder(com.google.cloud.iot.v1.ListDeviceStatesResponse prototype)293 public static Builder newBuilder(com.google.cloud.iot.v1.ListDeviceStatesResponse prototype) { 294 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 295 } 296 297 @java.lang.Override toBuilder()298 public Builder toBuilder() { 299 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 300 } 301 302 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)303 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 304 Builder builder = new Builder(parent); 305 return builder; 306 } 307 /** 308 * 309 * 310 * <pre> 311 * Response for `ListDeviceStates`. 312 * </pre> 313 * 314 * Protobuf type {@code google.cloud.iot.v1.ListDeviceStatesResponse} 315 */ 316 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 317 implements 318 // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.ListDeviceStatesResponse) 319 com.google.cloud.iot.v1.ListDeviceStatesResponseOrBuilder { getDescriptor()320 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 321 return com.google.cloud.iot.v1.DeviceManagerProto 322 .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor; 323 } 324 325 @java.lang.Override 326 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()327 internalGetFieldAccessorTable() { 328 return com.google.cloud.iot.v1.DeviceManagerProto 329 .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_fieldAccessorTable 330 .ensureFieldAccessorsInitialized( 331 com.google.cloud.iot.v1.ListDeviceStatesResponse.class, 332 com.google.cloud.iot.v1.ListDeviceStatesResponse.Builder.class); 333 } 334 335 // Construct using com.google.cloud.iot.v1.ListDeviceStatesResponse.newBuilder() Builder()336 private Builder() {} 337 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)338 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 339 super(parent); 340 } 341 342 @java.lang.Override clear()343 public Builder clear() { 344 super.clear(); 345 bitField0_ = 0; 346 if (deviceStatesBuilder_ == null) { 347 deviceStates_ = java.util.Collections.emptyList(); 348 } else { 349 deviceStates_ = null; 350 deviceStatesBuilder_.clear(); 351 } 352 bitField0_ = (bitField0_ & ~0x00000001); 353 return this; 354 } 355 356 @java.lang.Override getDescriptorForType()357 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 358 return com.google.cloud.iot.v1.DeviceManagerProto 359 .internal_static_google_cloud_iot_v1_ListDeviceStatesResponse_descriptor; 360 } 361 362 @java.lang.Override getDefaultInstanceForType()363 public com.google.cloud.iot.v1.ListDeviceStatesResponse getDefaultInstanceForType() { 364 return com.google.cloud.iot.v1.ListDeviceStatesResponse.getDefaultInstance(); 365 } 366 367 @java.lang.Override build()368 public com.google.cloud.iot.v1.ListDeviceStatesResponse build() { 369 com.google.cloud.iot.v1.ListDeviceStatesResponse result = buildPartial(); 370 if (!result.isInitialized()) { 371 throw newUninitializedMessageException(result); 372 } 373 return result; 374 } 375 376 @java.lang.Override buildPartial()377 public com.google.cloud.iot.v1.ListDeviceStatesResponse buildPartial() { 378 com.google.cloud.iot.v1.ListDeviceStatesResponse result = 379 new com.google.cloud.iot.v1.ListDeviceStatesResponse(this); 380 buildPartialRepeatedFields(result); 381 if (bitField0_ != 0) { 382 buildPartial0(result); 383 } 384 onBuilt(); 385 return result; 386 } 387 buildPartialRepeatedFields( com.google.cloud.iot.v1.ListDeviceStatesResponse result)388 private void buildPartialRepeatedFields( 389 com.google.cloud.iot.v1.ListDeviceStatesResponse result) { 390 if (deviceStatesBuilder_ == null) { 391 if (((bitField0_ & 0x00000001) != 0)) { 392 deviceStates_ = java.util.Collections.unmodifiableList(deviceStates_); 393 bitField0_ = (bitField0_ & ~0x00000001); 394 } 395 result.deviceStates_ = deviceStates_; 396 } else { 397 result.deviceStates_ = deviceStatesBuilder_.build(); 398 } 399 } 400 buildPartial0(com.google.cloud.iot.v1.ListDeviceStatesResponse result)401 private void buildPartial0(com.google.cloud.iot.v1.ListDeviceStatesResponse result) { 402 int from_bitField0_ = bitField0_; 403 } 404 405 @java.lang.Override clone()406 public Builder clone() { 407 return super.clone(); 408 } 409 410 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)411 public Builder setField( 412 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 413 return super.setField(field, value); 414 } 415 416 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)417 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 418 return super.clearField(field); 419 } 420 421 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)422 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 423 return super.clearOneof(oneof); 424 } 425 426 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)427 public Builder setRepeatedField( 428 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 429 return super.setRepeatedField(field, index, value); 430 } 431 432 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)433 public Builder addRepeatedField( 434 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 435 return super.addRepeatedField(field, value); 436 } 437 438 @java.lang.Override mergeFrom(com.google.protobuf.Message other)439 public Builder mergeFrom(com.google.protobuf.Message other) { 440 if (other instanceof com.google.cloud.iot.v1.ListDeviceStatesResponse) { 441 return mergeFrom((com.google.cloud.iot.v1.ListDeviceStatesResponse) other); 442 } else { 443 super.mergeFrom(other); 444 return this; 445 } 446 } 447 mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesResponse other)448 public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesResponse other) { 449 if (other == com.google.cloud.iot.v1.ListDeviceStatesResponse.getDefaultInstance()) 450 return this; 451 if (deviceStatesBuilder_ == null) { 452 if (!other.deviceStates_.isEmpty()) { 453 if (deviceStates_.isEmpty()) { 454 deviceStates_ = other.deviceStates_; 455 bitField0_ = (bitField0_ & ~0x00000001); 456 } else { 457 ensureDeviceStatesIsMutable(); 458 deviceStates_.addAll(other.deviceStates_); 459 } 460 onChanged(); 461 } 462 } else { 463 if (!other.deviceStates_.isEmpty()) { 464 if (deviceStatesBuilder_.isEmpty()) { 465 deviceStatesBuilder_.dispose(); 466 deviceStatesBuilder_ = null; 467 deviceStates_ = other.deviceStates_; 468 bitField0_ = (bitField0_ & ~0x00000001); 469 deviceStatesBuilder_ = 470 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 471 ? getDeviceStatesFieldBuilder() 472 : null; 473 } else { 474 deviceStatesBuilder_.addAllMessages(other.deviceStates_); 475 } 476 } 477 } 478 this.mergeUnknownFields(other.getUnknownFields()); 479 onChanged(); 480 return this; 481 } 482 483 @java.lang.Override isInitialized()484 public final boolean isInitialized() { 485 return true; 486 } 487 488 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)489 public Builder mergeFrom( 490 com.google.protobuf.CodedInputStream input, 491 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 492 throws java.io.IOException { 493 if (extensionRegistry == null) { 494 throw new java.lang.NullPointerException(); 495 } 496 try { 497 boolean done = false; 498 while (!done) { 499 int tag = input.readTag(); 500 switch (tag) { 501 case 0: 502 done = true; 503 break; 504 case 10: 505 { 506 com.google.cloud.iot.v1.DeviceState m = 507 input.readMessage( 508 com.google.cloud.iot.v1.DeviceState.parser(), extensionRegistry); 509 if (deviceStatesBuilder_ == null) { 510 ensureDeviceStatesIsMutable(); 511 deviceStates_.add(m); 512 } else { 513 deviceStatesBuilder_.addMessage(m); 514 } 515 break; 516 } // case 10 517 default: 518 { 519 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 520 done = true; // was an endgroup tag 521 } 522 break; 523 } // default: 524 } // switch (tag) 525 } // while (!done) 526 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 527 throw e.unwrapIOException(); 528 } finally { 529 onChanged(); 530 } // finally 531 return this; 532 } 533 534 private int bitField0_; 535 536 private java.util.List<com.google.cloud.iot.v1.DeviceState> deviceStates_ = 537 java.util.Collections.emptyList(); 538 ensureDeviceStatesIsMutable()539 private void ensureDeviceStatesIsMutable() { 540 if (!((bitField0_ & 0x00000001) != 0)) { 541 deviceStates_ = new java.util.ArrayList<com.google.cloud.iot.v1.DeviceState>(deviceStates_); 542 bitField0_ |= 0x00000001; 543 } 544 } 545 546 private com.google.protobuf.RepeatedFieldBuilderV3< 547 com.google.cloud.iot.v1.DeviceState, 548 com.google.cloud.iot.v1.DeviceState.Builder, 549 com.google.cloud.iot.v1.DeviceStateOrBuilder> 550 deviceStatesBuilder_; 551 552 /** 553 * 554 * 555 * <pre> 556 * The last few device states. States are listed in descending order of server 557 * update time, starting from the most recent one. 558 * </pre> 559 * 560 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 561 */ getDeviceStatesList()562 public java.util.List<com.google.cloud.iot.v1.DeviceState> getDeviceStatesList() { 563 if (deviceStatesBuilder_ == null) { 564 return java.util.Collections.unmodifiableList(deviceStates_); 565 } else { 566 return deviceStatesBuilder_.getMessageList(); 567 } 568 } 569 /** 570 * 571 * 572 * <pre> 573 * The last few device states. States are listed in descending order of server 574 * update time, starting from the most recent one. 575 * </pre> 576 * 577 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 578 */ getDeviceStatesCount()579 public int getDeviceStatesCount() { 580 if (deviceStatesBuilder_ == null) { 581 return deviceStates_.size(); 582 } else { 583 return deviceStatesBuilder_.getCount(); 584 } 585 } 586 /** 587 * 588 * 589 * <pre> 590 * The last few device states. States are listed in descending order of server 591 * update time, starting from the most recent one. 592 * </pre> 593 * 594 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 595 */ getDeviceStates(int index)596 public com.google.cloud.iot.v1.DeviceState getDeviceStates(int index) { 597 if (deviceStatesBuilder_ == null) { 598 return deviceStates_.get(index); 599 } else { 600 return deviceStatesBuilder_.getMessage(index); 601 } 602 } 603 /** 604 * 605 * 606 * <pre> 607 * The last few device states. States are listed in descending order of server 608 * update time, starting from the most recent one. 609 * </pre> 610 * 611 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 612 */ setDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value)613 public Builder setDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value) { 614 if (deviceStatesBuilder_ == null) { 615 if (value == null) { 616 throw new NullPointerException(); 617 } 618 ensureDeviceStatesIsMutable(); 619 deviceStates_.set(index, value); 620 onChanged(); 621 } else { 622 deviceStatesBuilder_.setMessage(index, value); 623 } 624 return this; 625 } 626 /** 627 * 628 * 629 * <pre> 630 * The last few device states. States are listed in descending order of server 631 * update time, starting from the most recent one. 632 * </pre> 633 * 634 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 635 */ setDeviceStates( int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue)636 public Builder setDeviceStates( 637 int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue) { 638 if (deviceStatesBuilder_ == null) { 639 ensureDeviceStatesIsMutable(); 640 deviceStates_.set(index, builderForValue.build()); 641 onChanged(); 642 } else { 643 deviceStatesBuilder_.setMessage(index, builderForValue.build()); 644 } 645 return this; 646 } 647 /** 648 * 649 * 650 * <pre> 651 * The last few device states. States are listed in descending order of server 652 * update time, starting from the most recent one. 653 * </pre> 654 * 655 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 656 */ addDeviceStates(com.google.cloud.iot.v1.DeviceState value)657 public Builder addDeviceStates(com.google.cloud.iot.v1.DeviceState value) { 658 if (deviceStatesBuilder_ == null) { 659 if (value == null) { 660 throw new NullPointerException(); 661 } 662 ensureDeviceStatesIsMutable(); 663 deviceStates_.add(value); 664 onChanged(); 665 } else { 666 deviceStatesBuilder_.addMessage(value); 667 } 668 return this; 669 } 670 /** 671 * 672 * 673 * <pre> 674 * The last few device states. States are listed in descending order of server 675 * update time, starting from the most recent one. 676 * </pre> 677 * 678 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 679 */ addDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value)680 public Builder addDeviceStates(int index, com.google.cloud.iot.v1.DeviceState value) { 681 if (deviceStatesBuilder_ == null) { 682 if (value == null) { 683 throw new NullPointerException(); 684 } 685 ensureDeviceStatesIsMutable(); 686 deviceStates_.add(index, value); 687 onChanged(); 688 } else { 689 deviceStatesBuilder_.addMessage(index, value); 690 } 691 return this; 692 } 693 /** 694 * 695 * 696 * <pre> 697 * The last few device states. States are listed in descending order of server 698 * update time, starting from the most recent one. 699 * </pre> 700 * 701 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 702 */ addDeviceStates(com.google.cloud.iot.v1.DeviceState.Builder builderForValue)703 public Builder addDeviceStates(com.google.cloud.iot.v1.DeviceState.Builder builderForValue) { 704 if (deviceStatesBuilder_ == null) { 705 ensureDeviceStatesIsMutable(); 706 deviceStates_.add(builderForValue.build()); 707 onChanged(); 708 } else { 709 deviceStatesBuilder_.addMessage(builderForValue.build()); 710 } 711 return this; 712 } 713 /** 714 * 715 * 716 * <pre> 717 * The last few device states. States are listed in descending order of server 718 * update time, starting from the most recent one. 719 * </pre> 720 * 721 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 722 */ addDeviceStates( int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue)723 public Builder addDeviceStates( 724 int index, com.google.cloud.iot.v1.DeviceState.Builder builderForValue) { 725 if (deviceStatesBuilder_ == null) { 726 ensureDeviceStatesIsMutable(); 727 deviceStates_.add(index, builderForValue.build()); 728 onChanged(); 729 } else { 730 deviceStatesBuilder_.addMessage(index, builderForValue.build()); 731 } 732 return this; 733 } 734 /** 735 * 736 * 737 * <pre> 738 * The last few device states. States are listed in descending order of server 739 * update time, starting from the most recent one. 740 * </pre> 741 * 742 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 743 */ addAllDeviceStates( java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceState> values)744 public Builder addAllDeviceStates( 745 java.lang.Iterable<? extends com.google.cloud.iot.v1.DeviceState> values) { 746 if (deviceStatesBuilder_ == null) { 747 ensureDeviceStatesIsMutable(); 748 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deviceStates_); 749 onChanged(); 750 } else { 751 deviceStatesBuilder_.addAllMessages(values); 752 } 753 return this; 754 } 755 /** 756 * 757 * 758 * <pre> 759 * The last few device states. States are listed in descending order of server 760 * update time, starting from the most recent one. 761 * </pre> 762 * 763 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 764 */ clearDeviceStates()765 public Builder clearDeviceStates() { 766 if (deviceStatesBuilder_ == null) { 767 deviceStates_ = java.util.Collections.emptyList(); 768 bitField0_ = (bitField0_ & ~0x00000001); 769 onChanged(); 770 } else { 771 deviceStatesBuilder_.clear(); 772 } 773 return this; 774 } 775 /** 776 * 777 * 778 * <pre> 779 * The last few device states. States are listed in descending order of server 780 * update time, starting from the most recent one. 781 * </pre> 782 * 783 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 784 */ removeDeviceStates(int index)785 public Builder removeDeviceStates(int index) { 786 if (deviceStatesBuilder_ == null) { 787 ensureDeviceStatesIsMutable(); 788 deviceStates_.remove(index); 789 onChanged(); 790 } else { 791 deviceStatesBuilder_.remove(index); 792 } 793 return this; 794 } 795 /** 796 * 797 * 798 * <pre> 799 * The last few device states. States are listed in descending order of server 800 * update time, starting from the most recent one. 801 * </pre> 802 * 803 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 804 */ getDeviceStatesBuilder(int index)805 public com.google.cloud.iot.v1.DeviceState.Builder getDeviceStatesBuilder(int index) { 806 return getDeviceStatesFieldBuilder().getBuilder(index); 807 } 808 /** 809 * 810 * 811 * <pre> 812 * The last few device states. States are listed in descending order of server 813 * update time, starting from the most recent one. 814 * </pre> 815 * 816 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 817 */ getDeviceStatesOrBuilder(int index)818 public com.google.cloud.iot.v1.DeviceStateOrBuilder getDeviceStatesOrBuilder(int index) { 819 if (deviceStatesBuilder_ == null) { 820 return deviceStates_.get(index); 821 } else { 822 return deviceStatesBuilder_.getMessageOrBuilder(index); 823 } 824 } 825 /** 826 * 827 * 828 * <pre> 829 * The last few device states. States are listed in descending order of server 830 * update time, starting from the most recent one. 831 * </pre> 832 * 833 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 834 */ 835 public java.util.List<? extends com.google.cloud.iot.v1.DeviceStateOrBuilder> getDeviceStatesOrBuilderList()836 getDeviceStatesOrBuilderList() { 837 if (deviceStatesBuilder_ != null) { 838 return deviceStatesBuilder_.getMessageOrBuilderList(); 839 } else { 840 return java.util.Collections.unmodifiableList(deviceStates_); 841 } 842 } 843 /** 844 * 845 * 846 * <pre> 847 * The last few device states. States are listed in descending order of server 848 * update time, starting from the most recent one. 849 * </pre> 850 * 851 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 852 */ addDeviceStatesBuilder()853 public com.google.cloud.iot.v1.DeviceState.Builder addDeviceStatesBuilder() { 854 return getDeviceStatesFieldBuilder() 855 .addBuilder(com.google.cloud.iot.v1.DeviceState.getDefaultInstance()); 856 } 857 /** 858 * 859 * 860 * <pre> 861 * The last few device states. States are listed in descending order of server 862 * update time, starting from the most recent one. 863 * </pre> 864 * 865 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 866 */ addDeviceStatesBuilder(int index)867 public com.google.cloud.iot.v1.DeviceState.Builder addDeviceStatesBuilder(int index) { 868 return getDeviceStatesFieldBuilder() 869 .addBuilder(index, com.google.cloud.iot.v1.DeviceState.getDefaultInstance()); 870 } 871 /** 872 * 873 * 874 * <pre> 875 * The last few device states. States are listed in descending order of server 876 * update time, starting from the most recent one. 877 * </pre> 878 * 879 * <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code> 880 */ 881 public java.util.List<com.google.cloud.iot.v1.DeviceState.Builder> getDeviceStatesBuilderList()882 getDeviceStatesBuilderList() { 883 return getDeviceStatesFieldBuilder().getBuilderList(); 884 } 885 886 private com.google.protobuf.RepeatedFieldBuilderV3< 887 com.google.cloud.iot.v1.DeviceState, 888 com.google.cloud.iot.v1.DeviceState.Builder, 889 com.google.cloud.iot.v1.DeviceStateOrBuilder> getDeviceStatesFieldBuilder()890 getDeviceStatesFieldBuilder() { 891 if (deviceStatesBuilder_ == null) { 892 deviceStatesBuilder_ = 893 new com.google.protobuf.RepeatedFieldBuilderV3< 894 com.google.cloud.iot.v1.DeviceState, 895 com.google.cloud.iot.v1.DeviceState.Builder, 896 com.google.cloud.iot.v1.DeviceStateOrBuilder>( 897 deviceStates_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); 898 deviceStates_ = null; 899 } 900 return deviceStatesBuilder_; 901 } 902 903 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)904 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 905 return super.setUnknownFields(unknownFields); 906 } 907 908 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)909 public final Builder mergeUnknownFields( 910 final com.google.protobuf.UnknownFieldSet unknownFields) { 911 return super.mergeUnknownFields(unknownFields); 912 } 913 914 // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.ListDeviceStatesResponse) 915 } 916 917 // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceStatesResponse) 918 private static final com.google.cloud.iot.v1.ListDeviceStatesResponse DEFAULT_INSTANCE; 919 920 static { 921 DEFAULT_INSTANCE = new com.google.cloud.iot.v1.ListDeviceStatesResponse(); 922 } 923 getDefaultInstance()924 public static com.google.cloud.iot.v1.ListDeviceStatesResponse getDefaultInstance() { 925 return DEFAULT_INSTANCE; 926 } 927 928 private static final com.google.protobuf.Parser<ListDeviceStatesResponse> PARSER = 929 new com.google.protobuf.AbstractParser<ListDeviceStatesResponse>() { 930 @java.lang.Override 931 public ListDeviceStatesResponse parsePartialFrom( 932 com.google.protobuf.CodedInputStream input, 933 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 934 throws com.google.protobuf.InvalidProtocolBufferException { 935 Builder builder = newBuilder(); 936 try { 937 builder.mergeFrom(input, extensionRegistry); 938 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 939 throw e.setUnfinishedMessage(builder.buildPartial()); 940 } catch (com.google.protobuf.UninitializedMessageException e) { 941 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 942 } catch (java.io.IOException e) { 943 throw new com.google.protobuf.InvalidProtocolBufferException(e) 944 .setUnfinishedMessage(builder.buildPartial()); 945 } 946 return builder.buildPartial(); 947 } 948 }; 949 parser()950 public static com.google.protobuf.Parser<ListDeviceStatesResponse> parser() { 951 return PARSER; 952 } 953 954 @java.lang.Override getParserForType()955 public com.google.protobuf.Parser<ListDeviceStatesResponse> getParserForType() { 956 return PARSER; 957 } 958 959 @java.lang.Override getDefaultInstanceForType()960 public com.google.cloud.iot.v1.ListDeviceStatesResponse getDefaultInstanceForType() { 961 return DEFAULT_INSTANCE; 962 } 963 } 964