Skip to content

Commit

Permalink
Fix nullability annotations on wildcard types
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Nov 14, 2023
1 parent a9c3eb7 commit 99e5b63
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface Mqtt3Subscribe extends Mqtt3Message {
* @return the {@link Mqtt3Subscription Subscriptions} of this Subscribe message. The list contains at least one
* Subscription.
*/
@Unmodifiable @NotNull List<@NotNull ? extends Mqtt3Subscription> getSubscriptions();
@Unmodifiable @NotNull List<? extends @NotNull Mqtt3Subscription> getSubscriptions();

@Override
default @NotNull Mqtt3MessageType getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public interface Mqtt3SubscribeBuilderBase<C extends Mqtt3SubscribeBuilderBase.C
* @since 1.2
*/
@CheckReturnValue
@NotNull C addSubscriptions(@NotNull Collection<@NotNull ? extends Mqtt3Subscription> subscriptions);
@NotNull C addSubscriptions(@NotNull Collection<? extends @NotNull Mqtt3Subscription> subscriptions);

/**
* Adds a stream of {@link Mqtt3Subscription}s to the {@link Mqtt3Subscribe#getSubscriptions() list of
Expand All @@ -87,7 +87,7 @@ public interface Mqtt3SubscribeBuilderBase<C extends Mqtt3SubscribeBuilderBase.C
* @since 1.2
*/
@CheckReturnValue
@NotNull C addSubscriptions(@NotNull Stream<@NotNull ? extends Mqtt3Subscription> subscriptions);
@NotNull C addSubscriptions(@NotNull Stream<? extends @NotNull Mqtt3Subscription> subscriptions);

/**
* {@link Mqtt3SubscribeBuilderBase} that is complete which means all mandatory fields are set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public interface Mqtt3Unsubscribe extends Mqtt3Message {
/**
* @return the Topic Filters of this Unsubscribe message. The list contains at least one Topic Filter.
*/
@Unmodifiable @NotNull List<@NotNull ? extends MqttTopicFilter> getTopicFilters();
@Unmodifiable @NotNull List<? extends @NotNull MqttTopicFilter> getTopicFilters();

@Override
default @NotNull Mqtt3MessageType getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface Mqtt5UserProperties {
/**
* @return the User Properties as an immutable list.
*/
@Unmodifiable @NotNull List<@NotNull ? extends Mqtt5UserProperty> asList();
@Unmodifiable @NotNull List<? extends @NotNull Mqtt5UserProperty> asList();

/**
* @return a builder for extending this collection of User Properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface Mqtt5UserPropertiesBuilderBase<B extends Mqtt5UserPropertiesBui
* @since 1.2
*/
@CheckReturnValue
@NotNull B addAll(@NotNull Collection<@NotNull ? extends Mqtt5UserProperty> userProperties);
@NotNull B addAll(@NotNull Collection<? extends @NotNull Mqtt5UserProperty> userProperties);

/**
* Adds a stream of {@link Mqtt5UserProperty User Properties}.
Expand All @@ -91,5 +91,5 @@ public interface Mqtt5UserPropertiesBuilderBase<B extends Mqtt5UserPropertiesBui
* @since 1.2
*/
@CheckReturnValue
@NotNull B addAll(@NotNull Stream<@NotNull ? extends Mqtt5UserProperty> userProperties);
@NotNull B addAll(@NotNull Stream<? extends @NotNull Mqtt5UserProperty> userProperties);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public interface Mqtt5Subscribe extends Mqtt5Message {
* @return the {@link Mqtt5Subscription Subscriptions} of this Subscribe message. The list contains at least one
* Subscription.
*/
@Unmodifiable @NotNull List<@NotNull ? extends Mqtt5Subscription> getSubscriptions();
@Unmodifiable @NotNull List<? extends @NotNull Mqtt5Subscription> getSubscriptions();

/**
* @return the optional user properties of this Subscribe message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ public interface Mqtt5SubscribeBuilderBase<C extends Mqtt5SubscribeBuilderBase.C
* @since 1.2
*/
@CheckReturnValue
@NotNull C addSubscriptions(@NotNull Collection<@NotNull ? extends Mqtt5Subscription> subscriptions);
@NotNull C addSubscriptions(@NotNull Collection<? extends @NotNull Mqtt5Subscription> subscriptions);

/**
* Adds a stream of {@link Mqtt5Subscription}s to the {@link Mqtt5Subscribe#getSubscriptions() list of
* subscriptions}. At least one subscription is mandatory.
* Adds a stream of {@link Mqtt5Subscription}s to the
* {@link Mqtt5Subscribe#getSubscriptions() list of subscriptions}. At least one subscription is mandatory.
*
* @param subscriptions the stream of subscriptions.
* @return the builder that is now complete as at least one subscription is set.
* @since 1.2
*/
@CheckReturnValue
@NotNull C addSubscriptions(@NotNull Stream<@NotNull ? extends Mqtt5Subscription> subscriptions);
@NotNull C addSubscriptions(@NotNull Stream<? extends @NotNull Mqtt5Subscription> subscriptions);

/**
* {@link Mqtt5SubscribeBuilderBase} that is complete which means all mandatory fields are set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public interface Mqtt5Unsubscribe extends Mqtt5Message {
/**
* @return the Topic Filters of this Unsubscribe message. The list contains at least one Topic Filter.
*/
@Unmodifiable @NotNull List<@NotNull ? extends MqttTopicFilter> getTopicFilters();
@Unmodifiable @NotNull List<? extends @NotNull MqttTopicFilter> getTopicFilters();

/**
* @return the optional user properties of this Unsubscribe message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public interface Mqtt5UnsubscribeBuilderBase<C extends Mqtt5UnsubscribeBuilderBa
* @since 1.2
*/
@CheckReturnValue
@NotNull C addTopicFilters(@NotNull Collection<@NotNull ? extends MqttTopicFilter> topicFilters);
@NotNull C addTopicFilters(@NotNull Collection<? extends @NotNull MqttTopicFilter> topicFilters);

/**
* Adds a stream of {@link MqttTopicFilter Topic Filters} to the {@link Mqtt5Unsubscribe#getTopicFilters() list of
Expand All @@ -102,7 +102,7 @@ public interface Mqtt5UnsubscribeBuilderBase<C extends Mqtt5UnsubscribeBuilderBa
* @since 1.2
*/
@CheckReturnValue
@NotNull C addTopicFilters(@NotNull Stream<@NotNull ? extends MqttTopicFilter> topicFilters);
@NotNull C addTopicFilters(@NotNull Stream<? extends @NotNull MqttTopicFilter> topicFilters);

/**
* Reverses the subscriptions of a Subscribe message by adding their Topic Filters.
Expand Down

0 comments on commit 99e5b63

Please sign in to comment.