Class ParameterValidator

java.lang.Object
software.amazon.lambda.durable.validation.ParameterValidator

public final class ParameterValidator extends Object
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 Details

    • MAX_OPERATION_NAME_LENGTH

      public static final int MAX_OPERATION_NAME_LENGTH
      See Also:
  • Method Details

    • validateDuration

      public static void validateDuration(Duration duration, String parameterName)
      Validates that a duration is at least 1 second.
      Parameters:
      duration - the duration to validate
      parameterName - the name of the parameter (for error messages)
      Throws:
      IllegalArgumentException - if duration is null or less than 1 second
    • validateOptionalDuration

      public static void validateOptionalDuration(Duration duration, String parameterName)
      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

      public static void validatePositiveInteger(Integer value, String parameterName)
      Validates that an integer value is positive (greater than 0).
      Parameters:
      value - the value to validate
      parameterName - the name of the parameter (for error messages)
      Throws:
      IllegalArgumentException - if value is null or not positive
    • validateOptionalPositiveInteger

      public static void validateOptionalPositiveInteger(Integer value, String parameterName)
      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

      public static void validateOperationName(String name)
    • validateOperationName

      public static void validateOperationName(String name, int maxLength)