Skip to content
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

chore: add generics to PostExecutionControl to reduce IDEs noise #594

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ private PostExecutionControl(
this.runtimeException = runtimeException;
}

public static PostExecutionControl onlyFinalizerAdded() {
return new PostExecutionControl(true, null, null);
public static <R extends CustomResource<?, ?>> PostExecutionControl<R> onlyFinalizerAdded() {
return new PostExecutionControl<>(true, null, null);
}

public static PostExecutionControl defaultDispatch() {
return new PostExecutionControl(false, null, null);
public static <R extends CustomResource<?, ?>> PostExecutionControl<R> defaultDispatch() {
return new PostExecutionControl<>(false, null, null);
}

public static <R extends CustomResource<?, ?>> PostExecutionControl<R> customResourceUpdated(
R updatedCustomResource) {
return new PostExecutionControl<>(false, updatedCustomResource, null);
}

public static PostExecutionControl exceptionDuringExecution(RuntimeException exception) {
return new PostExecutionControl(false, null, exception);
public static <R extends CustomResource<?, ?>> PostExecutionControl<R> exceptionDuringExecution(
RuntimeException exception) {
return new PostExecutionControl<>(false, null, exception);
}

public boolean isOnlyFinalizerHandled() {
Expand All @@ -54,7 +55,7 @@ public boolean exceptionDuringExecution() {
return runtimeException != null;
}

public PostExecutionControl withReSchedule(long delay) {
public PostExecutionControl<R> withReSchedule(long delay) {
this.reScheduleDelay = delay;
return this;
}
Expand Down