Annotation Type IntRange


  • @Documented
    @Retention(SOURCE)
    @Target({METHOD,PARAMETER,FIELD,LOCAL_VARIABLE,ANNOTATION_TYPE})
    public @interface 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() {
          ...
      }
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      long from
      Smallest value, inclusive
      long to
      Largest value, inclusive
    • Element Detail

      • from

        long from
        Smallest value, inclusive
        Default:
        -9223372036854775808L
      • to

        long to
        Largest value, inclusive
        Default:
        9223372036854775807L