Class ParameterValidator
java.lang.Object
software.amazon.lambda.durable.util.ParameterValidator
Utility class for validating input parameters in the Durable Execution SDK.
Provides common validation methods to ensure consistent error messages and validation logic across the SDK.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvalidateDuration(Duration duration, String parameterName) Validates that a duration is at least 1 second.static voidvalidateOperationName(String name) static voidvalidateOperationName(String name, int maxLength) static voidvalidateOptionalDuration(Duration duration, String parameterName) Validates that an optional duration (if provided) is at least 1 second.static voidvalidateOptionalPositiveInteger(Integer value, String parameterName) Validates that an optional integer value (if provided) is positive (greater than 0).static voidvalidateOrderedCollection(Collection<?> items) Validates that a collection has deterministic iteration order.static voidvalidatePositiveInteger(Integer value, String parameterName) Validates that an integer value is positive (greater than 0).
-
Field Details
-
MAX_OPERATION_NAME_LENGTH
public static final int MAX_OPERATION_NAME_LENGTH- See Also:
-
-
Method Details
-
validateDuration
Validates that a duration is at least 1 second.- Parameters:
duration- the duration to validateparameterName- the name of the parameter (for error messages)- Throws:
IllegalArgumentException- if duration is null or less than 1 second
-
validateOptionalDuration
Validates that an optional duration (if provided) is at least 1 second.- Parameters:
duration- the duration to validate (can be null)parameterName- the name of the parameter (for error messages)- Throws:
IllegalArgumentException- if duration is non-null and less than 1 second
-
validatePositiveInteger
Validates that an integer value is positive (greater than 0).- Parameters:
value- the value to validateparameterName- the name of the parameter (for error messages)- Throws:
IllegalArgumentException- if value is null or not positive
-
validateOptionalPositiveInteger
Validates that an optional integer value (if provided) is positive (greater than 0).- Parameters:
value- the value to validate (can be null)parameterName- the name of the parameter (for error messages)- Throws:
IllegalArgumentException- if value is non-null and not positive
-
validateOperationName
-
validateOperationName
-
validateOrderedCollection
Validates that a collection has deterministic iteration order.Rejects known unordered collection types:
HashSet(but notLinkedHashSet, which has stable insertion-order iteration), and views returned byHashMap,IdentityHashMap,WeakHashMap, andConcurrentHashMap.- Parameters:
items- the collection to validate- Throws:
IllegalArgumentException- if items is null or has non-deterministic iteration order
-