/** * * * <pre> * The new definition of the group. All fields of the existing group, * excepting `name`, are replaced with the corresponding fields of this group. * </pre> * * <code>.google.monitoring.v3.Group group = 2;</code> */ public com.google.monitoring.v3.GroupOrBuilder getGroupOrBuilder() { return getGroup(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (group_ != null) { output.writeMessage(2, getGroup()); } if (validateOnly_ != false) { output.writeBool(3, validateOnly_); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (group_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getGroup()); } if (validateOnly_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasGroup()) { hash = (37 * hash) + GROUP_FIELD_NUMBER; hash = (53 * hash) + getGroup().hashCode(); } hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.UpdateGroupRequest)) { return super.equals(obj); } com.google.monitoring.v3.UpdateGroupRequest other = (com.google.monitoring.v3.UpdateGroupRequest) obj; boolean result = true; result = result && (hasGroup() == other.hasGroup()); if (hasGroup()) { result = result && getGroup().equals(other.getGroup()); } result = result && (getValidateOnly() == other.getValidateOnly()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.monitoring.v3.UpdateGroupRequest other) { if (other == com.google.monitoring.v3.UpdateGroupRequest.getDefaultInstance()) return this; if (other.hasGroup()) { mergeGroup(other.getGroup()); } if (other.getValidateOnly() != false) { setValidateOnly(other.getValidateOnly()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void updateGroupTest() { GroupName name = GroupName.of("[PROJECT]", "[GROUP]"); String displayName = "displayName1615086568"; GroupName parentName = GroupName.of("[PROJECT]", "[GROUP]"); String filter = "filter-1274492040"; boolean isCluster = false; Group expectedResponse = Group.newBuilder() .setName(name.toString()) .setDisplayName(displayName) .setParentName(parentName.toString()) .setFilter(filter) .setIsCluster(isCluster) .build(); mockGroupService.addResponse(expectedResponse); Group group = Group.newBuilder().build(); Group actualResponse = client.updateGroup(group); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateGroupRequest actualRequest = (UpdateGroupRequest) actualRequests.get(0); Assert.assertEquals(group, actualRequest.getGroup()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * <pre> * The new definition of the group. All fields of the existing group, * excepting `name`, are replaced with the corresponding fields of this group. * </pre> * * <code>optional .google.monitoring.v3.Group group = 2;</code> */ public com.google.monitoring.v3.GroupOrBuilder getGroupOrBuilder() { return getGroup(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (group_ != null) { output.writeMessage(2, getGroup()); } if (validateOnly_ != false) { output.writeBool(3, validateOnly_); } }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (group_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getGroup()); } if (validateOnly_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(3, validateOnly_); } memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasGroup()) { hash = (37 * hash) + GROUP_FIELD_NUMBER; hash = (53 * hash) + getGroup().hashCode(); } hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getValidateOnly()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.UpdateGroupRequest)) { return super.equals(obj); } com.google.monitoring.v3.UpdateGroupRequest other = (com.google.monitoring.v3.UpdateGroupRequest) obj; boolean result = true; result = result && (hasGroup() == other.hasGroup()); if (hasGroup()) { result = result && getGroup() .equals(other.getGroup()); } result = result && (getValidateOnly() == other.getValidateOnly()); return result; }
public Builder mergeFrom(com.google.monitoring.v3.UpdateGroupRequest other) { if (other == com.google.monitoring.v3.UpdateGroupRequest.getDefaultInstance()) return this; if (other.hasGroup()) { mergeGroup(other.getGroup()); } if (other.getValidateOnly() != false) { setValidateOnly(other.getValidateOnly()); } onChanged(); return this; }