Annotation Interface FloatRange


Denotes that the annotated element should be a float or double in the given range

Example:


  @FloatRange(from=0.0,to=1.0)
  public float getAlpha() {
      ...
  }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    double
    Smallest value.
    boolean
    Whether the from value is included in the range
    double
    Largest value.
    boolean
    Whether the to value is included in the range
  • Element Details

    • from

      double from
      Smallest value. Whether it is inclusive or not is determined by fromInclusive()
      Default:
      -1.0/0.0
    • to

      double to
      Largest value. Whether it is inclusive or not is determined by toInclusive()
      Default:
      1.0/0.0
    • fromInclusive

      boolean fromInclusive
      Whether the from value is included in the range
      Default:
      true
    • toInclusive

      boolean toInclusive
      Whether the to value is included in the range
      Default:
      true