Package org.instancio.internal.util
Class BeanValidationUtils
java.lang.Object
org.instancio.internal.util.BeanValidationUtils
-
Method Summary
Modifier and TypeMethodDescriptioncalculateRange(int min, int max, int maxLimit) Attempts to calculate a reasonable range for the given min/max values.static voidsetNonNullablePrimitive(GeneratorSpec<?> spec, Field field)
-
Method Details
-
calculateRange
Attempts to calculate a reasonable range for the given min/max values. For example, theSizeannotation has a default max value ofInteger.MAX_VALUE.Note: if min is 0, will return min 1, unless max is also zero.
- Parameters:
min- value specified by an annotationmax- value specified by an annotationmaxLimit- when min is zero, limit max to this value- Returns:
- a range containing the same values as provided, or an updated range with new max, smaller than the original.
-
setNonNullablePrimitive
-