Annotation Type ProtoReserved.Range

Enclosing class:
ProtoReserved

public static @interface ProtoReserved.Range
A range of field numbers or enum constants. The upper bound can be left unspecified if 'max' is desired. The acceptable values for from() and to() are different for fields vs. enum constants.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    The start of the range (inclusive).
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The end of the range (inclusive).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum allowed value for enums.
    static final int
    Maximum allowed value for field numbers.
  • Field Details

    • MAX_FIELD

      static final int MAX_FIELD
      Maximum allowed value for field numbers.
      See Also:
    • MAX_ENUM

      static final int MAX_ENUM
      Maximum allowed value for enums.
      See Also:
  • Element Details

    • from

      int from
      The start of the range (inclusive). Minimum value is 1 for field numbers, but can be any 32-bit value for enums (including negative values).
    • to

      int to
      The end of the range (inclusive). Must be strictly greater than from(). The actual maximum is MAX_FIELD (229-1 = 536870911) for field numbers, but it can be any 32-bit value for enums.
      Default:
      2147483647