Class NumericField


  • public class NumericField
    extends Field
    Represents a field which may contain only integer values.
    • Constructor Detail

      • NumericField

        public NumericField​(String name)
        Creates a new NumericField with the given name.
        Parameters:
        name - The unique name to associate with this field.
    • Method Detail

      • format

        public static String format​(Integer i)
        Formats the given integer in the format required by a numeric field.
        Parameters:
        i - The integer to format, which may be null.
        Returns:
        A string representation of the given integer, or null if the given integer was null.
      • parse

        public static Integer parse​(String str)
                             throws NumberFormatException
        Parses the given string as an integer, where the given string is in the format required by a numeric field.
        Parameters:
        str - The string to parse as an integer, which may be null.
        Returns:
        The integer representation of the given string, or null if the given string was null.
        Throws:
        NumberFormatException - If the given string is not in a parseable format.