Top Description Methods
org.jetbrains.annotations

public @Interface Range

extends Annotation
Annotations
@Documented
@Retention:CLASS
@Target:TYPE_USE
Imports
java.lang.annotation.*

An annotation which allows to specify for integral type (byte, char, short, int, long) an allowed values range. Applying this annotation to other types is not correct.

Example:

public @Range(from = 0, to = Integer.MAX_VALUE) int length() {
  return this.length; // returns a non-negative integer
}
Since
17.0.0

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

minimal allowed value (inclusive)
from
()

public long

Returns:

maximal allowed value (inclusive)
to
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

fromback to summary
public long from()
Returns:long

minimal allowed value (inclusive)

toback to summary
public long to()
Returns:long

maximal allowed value (inclusive)