@MustBeDocumented
@Retention(value = AnnotationRetention.BINARY)
@Target(allowedTargets = [AnnotationTarget.FUNCTIONAnnotationTarget.PROPERTY_GETTERAnnotationTarget.PROPERTY_SETTERAnnotationTarget.VALUE_PARAMETERAnnotationTarget.FIELDAnnotationTarget.LOCAL_VARIABLEAnnotationTarget.ANNOTATION_CLASS])
public annotation IntRange

Denotes that the annotated element should be an int or long in the given range.

Example:

@IntRange(from=0,to=255)
public int getAlpha() {
...
}

Summary

Public constructors

IntRange(long from, long to)

Public methods

final long

Smallest value, inclusive

final long

Largest value, inclusive

Public constructors

IntRange

public IntRange(long from, long to)

Public methods

getFrom

public final long getFrom()

Smallest value, inclusive

getTo

public final long getTo()

Largest value, inclusive

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-07-17 UTC.