Refine contribution #3932

* Add default methods in interfaces
* Update tests/Javadoc
* Optimize imports
* Apply code style formatting
This commit is contained in:
Mahmoud Ben Hassine
2022-11-23 08:05:39 +01:00
parent 5a35b03300
commit 596ee705c8
8 changed files with 46 additions and 33 deletions

View File

@@ -95,14 +95,17 @@ public interface JobExplorer {
JobInstance getJobInstance(@Nullable Long instanceId);
/**
* @param jobName {@link String} name for the jobInstance.
* @param jobParameters {@link JobParameters} parameters for the jobInstance.
* @return the {@link JobInstance} with this name and parameters, or null
* @param jobName {@link String} name of the job.
* @param jobParameters {@link JobParameters} parameters for the job instance.
* @return the {@link JobInstance} with the given name and parameters, or
* {@code null}.
*
* @since 5.0
*/
@Nullable
JobInstance getJobInstance(String jobName, JobParameters jobParameters);
default JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
throw new UnsupportedOperationException();
}
/**
* Retrieve job executions by their job instance. The corresponding step executions

View File

@@ -40,7 +40,6 @@ import java.util.Set;
* @author Will Schipp
* @author Mahmoud Ben Hassine
* @author Parikshit Dutta
*
* @see JobExplorer
* @see JobInstanceDao
* @see JobExecutionDao
@@ -191,8 +190,7 @@ public class SimpleJobExplorer implements JobExplorer {
/*
* (non-Javadoc)
*
* @see
* org.springframework.batch.core.explore.JobExplorer#getJobInstance(java
* @see org.springframework.batch.core.explore.JobExplorer#getJobInstance(java
* .lang.String, org.springframework.batch.core.JobParameters)
*/
@Nullable

View File

@@ -188,14 +188,17 @@ public interface JobRepository {
void updateExecutionContext(JobExecution jobExecution);
/**
* @param jobName {@link String} the name of the jobInstance
* @param jobParameters {@link JobParameters} parameters identifying the {@link JobInstance}
* @return the {@link JobInstance} with name and parameters, or null
* @param jobName {@link String} name of the job.
* @param jobParameters {@link JobParameters} parameters for the job instance.
* @return the {@link JobInstance} with the given name and parameters, or
* {@code null}.
*
* @since 5.0
*/
@Nullable
JobInstance getJobInstance(String jobName, JobParameters jobParameters);
default JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
throw new UnsupportedOperationException();
}
/**
* @param jobInstance {@link JobInstance} instance containing the step executions.

View File

@@ -54,7 +54,6 @@ import java.util.List;
* @author Mahmoud Ben Hassine
* @author Baris Cubukcuoglu
* @author Parikshit Dutta
*
* @see JobRepository
* @see JobInstanceDao
* @see JobExecutionDao