Skip to content

Commit

Permalink
add @nonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyongrui authored and holiday12138 committed Oct 29, 2019
1 parent 9dfe4a3 commit c258a31
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions thain-core/src/main/java/com/xiaomi/thain/core/ThainFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ private ThainFacade(@NonNull ProcessEngineConfiguration processEngineConfigurati
schedulerEngine.start();
}

public static ThainFacade getInstance(ProcessEngineConfiguration processEngineConfiguration,
SchedulerEngineConfiguration schedulerEngineConfiguration)
public static ThainFacade getInstance(@NonNull ProcessEngineConfiguration processEngineConfiguration,
@NonNull SchedulerEngineConfiguration schedulerEngineConfiguration)
throws ThainSchedulerException, ThainMissRequiredArgumentsException, IOException, SQLException {
return new ThainFacade(processEngineConfiguration, schedulerEngineConfiguration);
}

/**
* 新建任务, cron为空的则只部署,不调度, 这个flowJson是不含id的,如果含id也没用
*/
public long addFlow(AddRq addRq) throws ThainException {
public long addFlow(@NonNull AddRq addRq) throws ThainException {
val flowId = processEngine.addFlow(addRq.flowModel, addRq.jobModelList).orElseThrow(() -> new ThainException("failed to insert flow"));
if (StringUtils.isBlank(addRq.flowModel.cron)) {
return flowId;
Expand All @@ -79,15 +79,15 @@ public long addFlow(AddRq addRq) throws ThainException {
return flowId;
}

public long updateFlow(String flowJson) throws SchedulerException, ThainException, ParseException {
public long updateFlow(@NonNull String flowJson) throws SchedulerException, ThainException, ParseException {
val addDto = JSON.parseObject(flowJson, AddRq.class);
return updateFlow(addDto);
}

/**
* 更新flow
*/
public long updateFlow(AddRq addRq) throws SchedulerException, ThainException, ParseException {
public long updateFlow(@NonNull AddRq addRq) throws SchedulerException, ThainException, ParseException {
val flowModel = addRq.flowModel;
val jobModelList = addRq.jobModelList;

Expand Down

0 comments on commit c258a31

Please sign in to comment.