/** * * * <pre> * The name of the note in the form of * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public io.grafeas.v1beta1.GetNoteRequest buildPartial() { io.grafeas.v1beta1.GetNoteRequest result = new io.grafeas.v1beta1.GetNoteRequest(this); result.name_ = name_; onBuilt(); 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 = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@java.lang.Override public io.grafeas.v1beta1.GetNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.GetNoteRequest)) { return super.equals(obj); } io.grafeas.v1beta1.GetNoteRequest other = (io.grafeas.v1beta1.GetNoteRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); }
@java.lang.Override public io.grafeas.v1beta1.GetNoteRequest build() { io.grafeas.v1beta1.GetNoteRequest 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 = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
private static io.grpc.MethodDescriptor< io.grafeas.v1beta1.GetNoteRequest, io.grafeas.v1beta1.Note> getGetNoteMethodHelper() { io.grpc.MethodDescriptor<io.grafeas.v1beta1.GetNoteRequest, io.grafeas.v1beta1.Note> getGetNoteMethod; if ((getGetNoteMethod = GrafeasV1Beta1Grpc.getGetNoteMethod) == null) { synchronized (GrafeasV1Beta1Grpc.class) { if ((getGetNoteMethod = GrafeasV1Beta1Grpc.getGetNoteMethod) == null) { GrafeasV1Beta1Grpc.getGetNoteMethod = getGetNoteMethod = io.grpc.MethodDescriptor .<io.grafeas.v1beta1.GetNoteRequest, io.grafeas.v1beta1.Note>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName( generateFullMethodName("grafeas.v1beta1.GrafeasV1Beta1", "GetNote")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( io.grafeas.v1beta1.Note.getDefaultInstance())) .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("GetNote")) .build(); } } } return getGetNoteMethod; }
@Test @SuppressWarnings("all") public void getNoteTest() { String name2 = "name2-1052831874"; String shortDescription = "shortDescription-235369287"; String longDescription = "longDescription-1747792199"; Note expectedResponse = Note.newBuilder() .setName(name2) .setShortDescription(shortDescription) .setLongDescription(longDescription) .build(); mockGrafeasV1Beta1.addResponse(expectedResponse); NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); Note actualResponse = client.getNote(name); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetNoteRequest actualRequest = (GetNoteRequest) actualRequests.get(0); Assert.assertEquals(name, NoteName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
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_); } unknownFields.writeTo(output); }
public static Builder newBuilder(io.grafeas.v1beta1.GetNoteRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
@java.lang.Override public io.grafeas.v1beta1.GetNoteRequest build() { io.grafeas.v1beta1.GetNoteRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public Builder mergeFrom(io.grafeas.v1beta1.GetNoteRequest other) { if (other == io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public io.grafeas.v1beta1.GetNoteRequest getDefaultInstanceForType() { return io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance(); }
/** * Gets the specified note. * * <p>Sample code: * * <pre><code> * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) { * NoteName name = NoteName.of("[PROJECT]", "[NOTE]"); * Note response = grafeasV1Beta1Client.getNote(name.toString()); * } * </code></pre> * * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Note getNote(String name) { GetNoteRequest request = GetNoteRequest.newBuilder().setName(name).build(); return getNote(request); }