public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other) { if (other == com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getNumStates() != 0) { setNumStates(other.getNumStates()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.cloud.iot.v1.ListDeviceStatesRequest buildPartial() { com.google.cloud.iot.v1.ListDeviceStatesRequest result = new com.google.cloud.iot.v1.ListDeviceStatesRequest(this); result.name_ = name_; result.numStates_ = numStates_; onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.iot.v1.ListDeviceStatesRequest)) { return super.equals(obj); } com.google.cloud.iot.v1.ListDeviceStatesRequest other = (com.google.cloud.iot.v1.ListDeviceStatesRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (getNumStates() == other.getNumStates()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + NUM_STATES_FIELD_NUMBER; hash = (53 * hash) + getNumStates(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The name of the device. For example, * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@Override public Map<String, String> extract(ListDeviceStatesRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } })
@java.lang.Override public com.google.cloud.iot.v1.ListDeviceStatesRequest getDefaultInstanceForType() { return com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance(); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (numStates_ != 0) { output.writeInt32(2, numStates_); } unknownFields.writeTo(output); }
@java.lang.Override public com.google.cloud.iot.v1.ListDeviceStatesRequest build() { com.google.cloud.iot.v1.ListDeviceStatesRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + NUM_STATES_FIELD_NUMBER; hash = (53 * hash) + getNumStates(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The name of the device. For example, * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.iot.v1.ListDeviceStatesRequest)) { return super.equals(obj); } com.google.cloud.iot.v1.ListDeviceStatesRequest other = (com.google.cloud.iot.v1.ListDeviceStatesRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (getNumStates() == other.getNumStates()); result = result && unknownFields.equals(other.unknownFields); return result; }
@Test @SuppressWarnings("all") public void listDeviceStatesTest() { ListDeviceStatesResponse expectedResponse = ListDeviceStatesResponse.newBuilder().build(); mockDeviceManager.addResponse(expectedResponse); DeviceName name = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]"); ListDeviceStatesResponse actualResponse = client.listDeviceStates(name); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockDeviceManager.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListDeviceStatesRequest actualRequest = (ListDeviceStatesRequest) actualRequests.get(0); Assert.assertEquals(name, DeviceName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (numStates_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, numStates_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public com.google.cloud.iot.v1.ListDeviceStatesRequest build() { com.google.cloud.iot.v1.ListDeviceStatesRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public Builder mergeFrom(com.google.cloud.iot.v1.ListDeviceStatesRequest other) { if (other == com.google.cloud.iot.v1.ListDeviceStatesRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.getNumStates() != 0) { setNumStates(other.getNumStates()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }