All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jqwik.api.arbitraries.SizableArbitrary Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package net.jqwik.api.arbitraries;

import org.apiguardian.api.*;

import net.jqwik.api.*;

import static org.apiguardian.api.API.Status.*;

/**
 * Fluent interface to configure arbitraries that have size constraints for generated values, e.g. collections and arrays.
 */
@API(status = MAINTAINED, since = "1.0")
public interface SizableArbitrary extends Arbitrary {

	/**
	 * Fix the size to {@code size}.
	 */
	default SizableArbitrary ofSize(int size) {
		return ofMinSize(size).ofMaxSize(size);
	}

	/**
	 * Set lower size boundary {@code minSize} (included).
	 */
	SizableArbitrary ofMinSize(int minSize);

	/**
	 * Set upper size boundary {@code maxSize} (included).
	 */
	SizableArbitrary ofMaxSize(int maxSize);
}