Skip to content

Commit

Permalink
fixes javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
coltmcnealy-lh committed Nov 25, 2024
1 parent 57c8e9b commit e363a3e
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 2 deletions.
59 changes: 59 additions & 0 deletions sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/LHExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,80 @@

public interface LHExpression extends Serializable {

/**
* Returns an expression whose value is the `other` added to this expression.
* @param other the value to be added to this expression.
* @return an expression whose value is the `other` added to this expression.
*/
LHExpression add(Serializable other);

/**
* Returns an expression whose value is the `other` subtracted from this expression.
* @param other the value to be subtracted from this expression.
* @return an expression whose value is the `other` subtracted from this expression.
*/
LHExpression subtract(Serializable other);

/**
* Returns an expression whose value is the `other` multiplied by this expression.
* @param other the value to be multiplied by this expression.
* @return an expression whose value is the `other` multiplied by this expression.
*/
LHExpression multiply(Serializable other);

/**
* Returns an expression whose value is this expression divided by the `other`.
* @param other the value to divide this expression by.
* @return an expression whose value is this expression divided by the `other`.
*/
LHExpression divide(Serializable other);

/**
* Returns an expression whose value is this expression extended by the `other`.
* @param other the value to extend this expression by.
* @return an expression whose value is this expression extended by the `other`.
*/
LHExpression extend(Serializable other);

/**
* Returns an expression whose value is this expression with all occurrences of
* `other` removed.
* @param other the value to remove from this expression.
* @return an expression whose value is this expression with all occurrences of
* `other` removed.
*/
LHExpression removeIfPresent(Serializable other);

/**
* Returns an expression whose value is this expression with the index specified
* by `other` removed.
*
* Valid only for JSON_ARR expressions.
* @param index the index at which to insert the `other`.
* @return an expression whose value is this expression with the `other` inserted
* at the specified `index`.
*/
LHExpression removeIndex(int index);

/**
* Returns an expression whose value is this expression with the index specified
* by `index` removed.
*
* Valid only for JSON_ARR expressions.
* @param index the index at which to remove the value.
* @return an expression whose value is this expression with the value at the
* specified `index` removed.
*/
LHExpression removeIndex(LHExpression index);

/**
* Returns an expression whose value is this expression with the key specified
* by `key` removed.
*
* Valid only for JSON_OBJ expressions.
* @param key the key to remove from this expression.
* @return an expression whose value is this expression with the key specified
* by `key` removed.
*/
LHExpression removeKey(Serializable key);
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,53 @@ public interface WorkflowThread {
*/
LHFormatString format(String format, WfRunVariable... args);

/**
* Creates a variable of type INT in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareInt(String name);

/**
* Creates a variable of type STR in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareStr(String name);

/**
* Creates a variable of type DOUBLE in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareDouble(String name);

/**
* Creates a variable of type BYTES in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareBytes(String name);

/**
* Creates a variable of type JSON_ARR in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareJsonArr(String name);

/**
* Creates a variable of type JSON_OBJ in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareJsonObj(String name);

/**
* Creates a variable of type BOOL in the ThreadSpec.
* @param name is the name of the variable.
* @return a WfRunVariable.
*/
WfRunVariable declareBool(String name);

/**
Expand Down Expand Up @@ -504,7 +539,7 @@ SpawnedThreads spawnThreadForEach(
* result is formed by removing all occurrences from RHS from the LHS. Valid only for LHS of type
* JSON_ARR.
* @param lhs is the left hand side of the expression.
* @param rhs is the right hand side of the expression, which is removed from the lhs.
* @param index is the right hand side of the expression, which is removed from the lhs.
* @return an LHExpression representing the result of the removal.
*/
LHExpression removeIndex(Serializable lhs, Serializable index);
Expand All @@ -513,7 +548,7 @@ SpawnedThreads spawnThreadForEach(
* Returns an expression that can be passed into a variable assignment/mutation or a TaskRun. The
* result is formed by removing the RHS key from the LHS. Valid only for LHS of type JSON_OBJ.
* @param lhs is the left hand side of the expression.
* @param rhs is the right hand side of the expression, which is removed from the lhs.
* @param key is the right hand side of the expression, which is removed from the lhs.
* @return an LHExpression representing the result of the removal.
*/
LHExpression removeKey(Serializable lhs, Serializable key);
Expand Down

0 comments on commit e363a3e

Please sign in to comment.