From e363a3e8a62aed2d8c4399a9193549d6d1695073 Mon Sep 17 00:00:00 2001 From: Colt McNealy Date: Mon, 25 Nov 2024 13:26:31 -0800 Subject: [PATCH] fixes javadoc --- .../littlehorse/sdk/wfsdk/LHExpression.java | 59 +++++++++++++++++++ .../littlehorse/sdk/wfsdk/WorkflowThread.java | 39 +++++++++++- 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/LHExpression.java b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/LHExpression.java index 75db0c54b..f42c49477 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/LHExpression.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/LHExpression.java @@ -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); } diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/WorkflowThread.java b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/WorkflowThread.java index 18737b43c..07701fa3b 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/WorkflowThread.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/WorkflowThread.java @@ -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); /** @@ -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); @@ -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);