Skip to content

Commit

Permalink
Cleanup builders
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Nov 27, 2023
1 parent cd65bad commit 2ae89cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public MqttRxClientBuilder() {}
}

@Override
public @NotNull MqttRxClientBuilder advancedConfig(final @NotNull Mqtt5AdvancedConfig advancedConfig) {
public @NotNull MqttRxClientBuilder advancedConfig(final @Nullable Mqtt5AdvancedConfig advancedConfig) {
this.advancedConfig = Checks.notImplemented(advancedConfig, MqttAdvancedConfig.class, "Advanced config");
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public Default() {}
public static class Nested<P> extends MqttConnectRestrictionsBuilder<Nested<P>>
implements Mqtt5ConnectRestrictionsBuilder.Nested<P>, Mqtt3ConnectRestrictionsBuilder.Nested<P> {

private final @NotNull Function<? super MqttConnectRestrictions, P> parentConsumer;

public Nested(
final @NotNull MqttConnectRestrictions restrictions,
final @NotNull Function<? super MqttConnectRestrictions, P> parentConsumer) {
Expand All @@ -133,8 +135,6 @@ public Nested(
this.parentConsumer = parentConsumer;
}

private final @NotNull Function<? super MqttConnectRestrictions, P> parentConsumer;

@Override
@NotNull Nested<P> self() {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public Mqtt3RxClientViewBuilder(
}
}

@Override
protected @NotNull Mqtt3RxClientViewBuilder self() {
return this;
}

private @NotNull MqttConnectedListener<MqttConnectedContextImpl> wrapConnectedListener(
final @NotNull MqttConnectedListener<? super Mqtt3ConnectedContextView> delegate) {
return context -> delegate.onConnected(new Mqtt3ConnectedContextView(context));
Expand Down Expand Up @@ -129,11 +134,6 @@ public Mqtt3RxClientViewBuilder(
return new Mqtt3PublishViewBuilder.WillNested<>(this::willPublish);
}

@Override
protected @NotNull Mqtt3RxClientViewBuilder self() {
return this;
}

@Override
public @NotNull Mqtt3RxClientView build() {
return buildRx();
Expand Down

0 comments on commit 2ae89cf

Please sign in to comment.