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

net.jqwik.api.constraints.UniqueElements Maven / Gradle / Ivy

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

import java.lang.annotation.*;
import java.util.function.*;

import org.apiguardian.api.*;

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

/**
 * Add a uniqueness constraint to a Collection, Stream or Array parameter.
 *
 * Applies to List, Set, Stream, and arrays which are also annotated with {@code @ForAll}.
 *
 * 

* Unlike the old and meanwhile removed annotation {@code Unique} this annotation is added to the * collection/array/stream parameter and NOT to the element type. *

* * @see net.jqwik.api.ForAll */ @Target({ ElementType.ANNOTATION_TYPE, ElementType.PARAMETER, ElementType.TYPE_USE }) @Retention(RetentionPolicy.RUNTIME) @Documented @API(status = MAINTAINED, since = "1.4.0") public @interface UniqueElements { class NOT_SET implements Function { @Override public Object apply(Object o) { throw new IllegalArgumentException("This class must not be used"); } } Class> by() default NOT_SET.class; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy