Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Add an EmptyMessage class, analogous to protobuf's Empty - #678

Merged
andreamlin merged 2 commits into
googleapis:masterfrom
andreamlin:emptyMessage
Feb 21, 2019
Merged

Add an EmptyMessage class, analogous to protobuf's Empty#678
andreamlin merged 2 commits into
googleapis:masterfrom
andreamlin:emptyMessage

Conversation

@andreamlin

Copy link
Copy Markdown
Contributor

This allows all interfaces that use ApiMessage to enforce that response objects have to be of type ApiMessage, which includes EmptyMessage. This replaces java.lang.Void as a response type.

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 21, 2019
@codecov

codecovBot commented Feb 21, 2019

Copy link
Copy Markdown

Codecov Report

Merging #678 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@ Coverage Diff @@## master #678 +/- ##
============================================
- Coverage 75.71% 75.63% -0.09% 
Complexity 1029 1029 ============================================
Files 194 195 +1 Lines 4608 4613 +5 Branches 356 356 ============================================
Hits 3489 3489 - Misses 961 966 +5 
Partials 158 158
Impacted FilesCoverage ΔComplexity Δ
...java/com/google/api/gax/httpjson/EmptyMessage.java0% <0%> (ø)0 <0> (?)
...om/google/api/gax/httpjson/HttpJsonStatusCode.java26.82% <0%> (-0.68%)7% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d41b922...4ff98f1. Read the comment docs.

@andreamlin

Copy link
Copy Markdown
ContributorAuthor

PTAL

@vam-googlevam-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comments about javadoc.

import javax.annotation.Nullable;

/**
* A generic empty message that you can re-use to avoid defining duplicated empty messages in your

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first time I see a javadoc written in this style (talking to the reader directly). Usually javadoc just talks about the class (i.e. s/"you can re-use"/"can be reused"). Please consider rephrasing it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


@Nullable
@Override
public Object getFieldValue(String fieldName) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some documentation for the public methods of a public class. (or add in /** {@inheritDoc} */ blocks)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@andreamlin
andreamlin merged commit 588b08f into googleapis:masterFeb 21, 2019
@andreamlin
andreamlin deleted the emptyMessage branch February 21, 2019 21:48
@andreamlinandreamlin mentioned this pull request Feb 21, 2019
andreamlin added a commit to googleapis/gapic-generator that referenced this pull request Feb 21, 2019
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
andreamlin added a commit to andreamlin/toolkit that referenced this pull request Feb 27, 2019
…leapis#2585)
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
andreamlin added a commit to andreamlin/toolkit that referenced this pull request Feb 27, 2019
…leapis#2585)
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
andreamlin added a commit to andreamlin/toolkit that referenced this pull request Feb 27, 2019
…leapis#2585)
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
andreamlin added a commit to andreamlin/toolkit that referenced this pull request Feb 27, 2019
…leapis#2585)
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
andreamlin added a commit to andreamlin/toolkit that referenced this pull request Feb 27, 2019
update baselines
support OperationApiCallable
remove double @BetaApis
remove BetaApi
remove OperationsClients from LRO methods
update java discogapic baseline
remove Operation as the fourth type in OperationCallable<..>
better?
parameterize HttpJsonCallableFactory
change Void to EmptyMessage
add lroMetadataTransformer
add in the piOperationTransformer
give http_stub getOperationsStub()
fix unit tests for http LRO
return Region/Zone/GlobalOperationClient
use ComputeLongRunningClientFactory
parameterize all Global/Region/Zone operation names
remove another GlobalOperation...
let Discogapic metadata type be the Operaton
ApimEssageOperationTransformers fixed!
cleanup
Use EmptyMessage instead of Void for HTTP response wrapper type (googleapis#2585)
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
remove a bunch of unnecessary things
make EmptyMessage have a default builder value in tests cases
generate OperationCallable
generate the ApiLongRunningClientView
formatting
generating OperationSnapshotView
Generating SimplecomputeLongRunningClientFactory but without actual tested generated constructors
@andreamlinandreamlin mentioned this pull request Feb 28, 2019
andreamlin added a commit to googleapis/gapic-generator that referenced this pull request Mar 1, 2019
This allows all interfaces that use `ApiMessage` to enforce that response objects have to be of type `ApiMessage`, which includes `EmptyMessage`. This replaces `java.lang.Void` as a response type.
Goes along with [googleapis/gax-java#678](googleapis/gax-java#678).
@andreamlinandreamlin mentioned this pull request Mar 5, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@andreamlin@vam-google@googlebot