Enum Class NumberReturnType

java.lang.Object
java.lang.Enum<NumberReturnType>
io.restassured.common.config.NumberReturnType
All Implemented Interfaces:
Serializable, Comparable<NumberReturnType>, Constable

public enum NumberReturnType extends Enum<NumberReturnType>
The type that JSON numbers are returned as.

Non-integer numbers can be returned as:

  • FLOAT_AND_DOUBLE (default)
  • BIG_DECIMAL
  • DOUBLE
Non-decimal numbers can be returned as BIG_INTEGER instead of int and long.
  • Enum Constant Details

    • FLOAT_AND_DOUBLE

      public static final NumberReturnType FLOAT_AND_DOUBLE
      Convert all non-integer numbers to floats and doubles (depending on the size of the number)
    • BIG_DECIMAL

      public static final NumberReturnType BIG_DECIMAL
      Convert all non-integer numbers to BigDecimal
    • DOUBLE

      public static final NumberReturnType DOUBLE
      Convert all non-integer numbers to doubles
    • BIG_INTEGER

      public static final NumberReturnType BIG_INTEGER
      Converts all non-decimal numbers to BigInteger
  • Method Details

    • values

      public static NumberReturnType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NumberReturnType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isFloatOrDouble

      public final boolean isFloatOrDouble()
      Returns a boolean indicating whether this type is included in those that deal with floats or doubles exclusive of BigDecimal.
      Returns:
      true if value is FLOAT_AND_DOUBLE or DOUBLE, false otherwise.