mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-03-10 08:51:19 +00:00
Annotate EventBus body parameters with Nullable - see #3199
This commit is contained in:
@@ -13,6 +13,7 @@ package io.vertx.core.eventbus;
|
||||
|
||||
import io.vertx.codegen.annotations.Fluent;
|
||||
import io.vertx.codegen.annotations.GenIgnore;
|
||||
import io.vertx.codegen.annotations.Nullable;
|
||||
import io.vertx.codegen.annotations.VertxGen;
|
||||
import io.vertx.core.AsyncResult;
|
||||
import io.vertx.core.Future;
|
||||
@@ -44,7 +45,7 @@ public interface EventBus extends Measured {
|
||||
* @return a reference to this, so the API can be used fluently
|
||||
*/
|
||||
@Fluent
|
||||
EventBus send(String address, Object message);
|
||||
EventBus send(String address, @Nullable Object message);
|
||||
|
||||
/**
|
||||
* Like {@link #send(String, Object)} but specifying {@code options} that can be used to configure the delivery.
|
||||
@@ -55,7 +56,7 @@ public interface EventBus extends Measured {
|
||||
* @return a reference to this, so the API can be used fluently
|
||||
*/
|
||||
@Fluent
|
||||
EventBus send(String address, Object message, DeliveryOptions options);
|
||||
EventBus send(String address, @Nullable Object message, DeliveryOptions options);
|
||||
|
||||
/**
|
||||
* Sends a message and and specify a {@code replyHandler} that will be called if the recipient
|
||||
@@ -69,14 +70,14 @@ public interface EventBus extends Measured {
|
||||
* @return a reference to this, so the API can be used fluently
|
||||
*/
|
||||
@Fluent
|
||||
default <T> EventBus request(String address, Object message, Handler<AsyncResult<Message<T>>> replyHandler) {
|
||||
default <T> EventBus request(String address, @Nullable Object message, Handler<AsyncResult<Message<T>>> replyHandler) {
|
||||
return request(address, message, new DeliveryOptions(), replyHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@link #request(String, Object, Handler)} but returns a {@code Future} of the asynchronous result
|
||||
*/
|
||||
default <T> Future<Message<T>> request(String address, Object message) {
|
||||
default <T> Future<Message<T>> request(String address, @Nullable Object message) {
|
||||
return request(address, message, new DeliveryOptions());
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@ public interface EventBus extends Measured {
|
||||
* @return a reference to this, so the API can be used fluently
|
||||
*/
|
||||
@Fluent
|
||||
default <T> EventBus request(String address, Object message, DeliveryOptions options, Handler<AsyncResult<Message<T>>> replyHandler) {
|
||||
default <T> EventBus request(String address, @Nullable Object message, DeliveryOptions options, Handler<AsyncResult<Message<T>>> replyHandler) {
|
||||
Future<Message<T>> reply = request(address, message, options);
|
||||
reply.setHandler(replyHandler);
|
||||
return this;
|
||||
@@ -99,7 +100,7 @@ public interface EventBus extends Measured {
|
||||
/**
|
||||
* Like {@link #request(String, Object, DeliveryOptions, Handler)} but returns a {@code Future} of the asynchronous result
|
||||
*/
|
||||
<T> Future<Message<T>> request(String address, Object message, DeliveryOptions options);
|
||||
<T> Future<Message<T>> request(String address, @Nullable Object message, DeliveryOptions options);
|
||||
|
||||
/**
|
||||
* Publish a message.<p>
|
||||
@@ -111,7 +112,7 @@ public interface EventBus extends Measured {
|
||||
*
|
||||
*/
|
||||
@Fluent
|
||||
EventBus publish(String address, Object message);
|
||||
EventBus publish(String address, @Nullable Object message);
|
||||
|
||||
/**
|
||||
* Like {@link #publish(String, Object)} but specifying {@code options} that can be used to configure the delivery.
|
||||
@@ -122,7 +123,7 @@ public interface EventBus extends Measured {
|
||||
* @return a reference to this, so the API can be used fluently
|
||||
*/
|
||||
@Fluent
|
||||
EventBus publish(String address, Object message, DeliveryOptions options);
|
||||
EventBus publish(String address, @Nullable Object message, DeliveryOptions options);
|
||||
|
||||
/**
|
||||
* Create a message consumer against the specified address.
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface Message<T> {
|
||||
*
|
||||
* @param message the message to reply with.
|
||||
*/
|
||||
default void reply(Object message) {
|
||||
default void reply(@Nullable Object message) {
|
||||
reply(message, new DeliveryOptions());
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public interface Message<T> {
|
||||
* @param message the reply message
|
||||
* @param options the delivery options
|
||||
*/
|
||||
void reply(Object message, DeliveryOptions options);
|
||||
void reply(@Nullable Object message, DeliveryOptions options);
|
||||
|
||||
/**
|
||||
* Reply to this message, specifying a {@code replyHandler} for the reply - i.e.
|
||||
@@ -100,14 +100,14 @@ public interface Message<T> {
|
||||
* @param message the message to reply with.
|
||||
* @param replyHandler the reply handler for the reply.
|
||||
*/
|
||||
default <R> void replyAndRequest(Object message, Handler<AsyncResult<Message<R>>> replyHandler) {
|
||||
default <R> void replyAndRequest(@Nullable Object message, Handler<AsyncResult<Message<R>>> replyHandler) {
|
||||
replyAndRequest(message, new DeliveryOptions(), replyHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@link #replyAndRequest(Object, Handler)} but returns a {@code Future} of the asynchronous result
|
||||
*/
|
||||
default <R> Future<Message<R>> replyAndRequest(Object message) {
|
||||
default <R> Future<Message<R>> replyAndRequest(@Nullable Object message) {
|
||||
return replyAndRequest(message, new DeliveryOptions());
|
||||
}
|
||||
|
||||
@@ -119,14 +119,14 @@ public interface Message<T> {
|
||||
* @param options delivery options
|
||||
* @param replyHandler reply handler will be called when any reply from the recipient is received
|
||||
*/
|
||||
default <R> void replyAndRequest(Object message, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler) {
|
||||
default <R> void replyAndRequest(@Nullable Object message, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler) {
|
||||
this.<R>replyAndRequest(message, options).setHandler(replyHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@link #replyAndRequest(Object, DeliveryOptions, Handler)} but returns a {@code Future} of the asynchronous result
|
||||
*/
|
||||
<R> Future<Message<R>> replyAndRequest(Object message, DeliveryOptions options);
|
||||
<R> Future<Message<R>> replyAndRequest(@Nullable Object message, DeliveryOptions options);
|
||||
|
||||
/**
|
||||
* Signal to the sender that processing of this message failed.
|
||||
|
||||
Reference in New Issue
Block a user