Skip to content

Commit

Permalink
Added JavaDocs for new generic parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lane Spade committed Apr 15, 2024
1 parent ff05c15 commit 6a3322c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
6 changes: 5 additions & 1 deletion src/main/java/io/iworkflow/core/StateDecision.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static StateDecision forceCompleteIfInternalChannelEmptyOrElse(final Obje
.build();
}

public static <I> StateDecision forceCompleteIfSignalChannelEmptyOrElse(final String signalChannelName, final Class<? extends WorkflowState<? extends I>> orElseStateClass) {
public static <I> StateDecision forceCompleteIfSignalChannelEmptyOrElse(final String signalChannelName, final Class<? extends WorkflowState<? extends I>> orElseStateClass) {
return forceCompleteIfSignalChannelEmptyOrElse(signalChannelName, orElseStateClass, null);
}

Expand Down Expand Up @@ -147,6 +147,7 @@ public static StateDecision forceCompleteIfSignalChannelEmptyOrElse(final Object
}

/**
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @param stateInput optional, can be null
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
Expand All @@ -157,6 +158,7 @@ public static <I> StateDecision singleNextState(final Class<? extends WorkflowSt
}

/**
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @param stateInput optional, can be null
* @return state decision
Expand All @@ -166,6 +168,7 @@ public static <I> StateDecision singleNextState(final Class<? extends WorkflowSt
}

/**
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @return state decision
*/
Expand All @@ -176,6 +179,7 @@ public static <I> StateDecision singleNextState(final Class<? extends WorkflowSt
/**
* use the other one with WorkflowState class param if the stateId is provided by default, to make your code cleaner
*
* @param <I> Class type of the WorkflowState input
* @param stateId required. StateId of next state
* @param stateInput optional, can be null. Input for next state
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
Expand Down
30 changes: 17 additions & 13 deletions src/main/java/io/iworkflow/core/StateMovement.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public abstract class StateMovement {
public abstract String getStateId();

public abstract Optional<Object> getStateInput();

public abstract Optional<WorkflowStateOptions> getStateOptionsOverride();

public final static String RESERVED_STATE_ID_PREFIX = "_SYS_";
Expand Down Expand Up @@ -53,29 +54,29 @@ public static StateMovement forceFailWorkflow(final Object output) {
}

/**
*
* @param stateClass required
* @param stateInput optional, can be null
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @param stateInput optional, can be null
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
* @return state movement
*/
public static <I> StateMovement create(final Class<? extends WorkflowState<? extends I>> stateClass, final I stateInput, final WorkflowStateOptions stateOptionsOverride) {
return create(stateClass.getSimpleName(), stateInput, stateOptionsOverride);
}

/**
*
* @param stateClass required
* @param stateInput optional, can be null
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @param stateInput optional, can be null
* @return state movement
*/
public static <I> StateMovement create(final Class<? extends WorkflowState<? extends I>> stateClass, final I stateInput) {
return create(stateClass, stateInput, null);
}

/**
*
* @param stateClass required
* @param <I> Class type of the WorkflowState input
* @param stateClass required
* @return state movement
*/
public static <I> StateMovement create(final Class<? extends WorkflowState<? extends I>> stateClass) {
Expand All @@ -84,9 +85,11 @@ public static <I> StateMovement create(final Class<? extends WorkflowState<? ext

/**
* use the other one with WorkflowState class param if the stateId is provided by default, to make your code cleaner
* @param stateId required
* @param stateInput optional, can be null
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
*
* @param <I> Class type of the WorkflowState input
* @param stateId required
* @param stateInput optional, can be null
* @param stateOptionsOverride optional, can be null. It is used to override the defined one in the State class
* @return state movement
*/
public static <I> StateMovement create(final String stateId, final I stateInput, final WorkflowStateOptions stateOptionsOverride) {
Expand All @@ -110,7 +113,8 @@ public static <I> StateMovement create(final String stateId, final I stateInput,

/**
* use the other one with WorkflowState class param if the stateId is provided by default, to make your code cleaner
* @param stateId stateId
*
* @param stateId stateId
* @return state movement
*/
public static StateMovement create(final String stateId) {
Expand Down

0 comments on commit 6a3322c

Please sign in to comment.