Class AdvancedRandomNumberFunction
java.lang.Object
org.citrusframework.functions.core.AdvancedRandomNumberFunction
- All Implemented Interfaces:
org.citrusframework.functions.Function
public class AdvancedRandomNumberFunction
extends Object
implements org.citrusframework.functions.Function
A function for generating random double values with specified decimal places and range. This
function includes options to specify the number of decimal places, minimum and maximum values,
and whether to include or exclude the minimum and maximum values.
Parameters:
- Decimal places: The number of decimal places in the generated random number (optional, default: 0). Note that definition of 0 results in an integer.
- Min value: The minimum value for the generated random number (optional, default:
DEFAULT_MIN_VALUE). - Max value: The maximum value for the generated random number (optional, default:
DEFAULT_MAX_VALUE). - Exclude min: Whether to exclude the minimum value (optional, default: false).
- Exclude max: Whether to exclude the maximum value (optional, default: false).
- Multiple of: The generated number will be a multiple of this value (optional).
- Format pattern: The format pattern for the returned string (optional, default: null)</li
-
Field Summary
Fields inherited from interface org.citrusframework.functions.Function
functions, logger, RESOURCE_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatRandomNumber(BigDecimal randomValue, int decimalPlaces, String formatPattern)
-
Constructor Details
-
AdvancedRandomNumberFunction
public AdvancedRandomNumberFunction()
-
-
Method Details
-
execute
- Specified by:
executein interfaceorg.citrusframework.functions.Function
-
formatRandomNumber
public static String formatRandomNumber(BigDecimal randomValue, int decimalPlaces, String formatPattern)
-