-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add FunctionalInterface
annotation
#1515
Changes from 4 commits
ce3aab0
a24b853
dcd832f
092fb12
52bc5c4
00fc12d
9c844b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
/** Provider of custom REST ClientInterceptors. */ | ||
@BetaApi( | ||
"The surface for adding custom interceptors is not stable yet and may change in the future.") | ||
@FunctionalInterface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove this as well since it's beta? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
public interface HttpJsonInterceptorProvider { | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
*/ | ||
package com.google.api.gax.batching; | ||
|
||
@FunctionalInterface | ||
public interface BatchMerger<B> { | ||
void merge(B batch, B newBatch); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In future, if we would add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interface is called |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and above inner-public interface are so weird, probably because we wanted to mimic the same behavior of
java.util.function.Supplier
in Java 7. That being said, I think addingFunctionalInterface
to them are appropriate because they are exposed on the surface through other public methods. But we may want to consider replacing theseSupplier
withjava.util.function.Supplier
as part of the Java 8 adoption project. CC: @suztomoThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments.
I'll do a research on replacing
Supplier
withjava.util.function.Supplier
. Leave it as-is as this is out of scope of this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would break binary compatibility, and so we'd need a major rev bump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to the idea of replacing
Supplier
withjava.util.function.Supplier
? I think it depends on how we approach it, if we do it naively yes it would be a breaking change. We could approach it in steps like adding alternatives first, replacing the ones that are not on the surface first etc.