public static Matcher jsonNumber()

in jackson/src/main/java/com/spotify/hamcrest/jackson/IsJsonNumber.java [71:89]


  public static Matcher<JsonNode> jsonNumber(final NumericNode value) {
    final JsonParser.NumberType numberType = value.numberType();
    switch (numberType) {
      case INT:
        return jsonInt(value.asInt());
      case LONG:
        return jsonLong(value.asLong());
      case BIG_INTEGER:
        return jsonBigInteger(value.bigIntegerValue());
      case FLOAT:
        return jsonFloat(value.floatValue());
      case DOUBLE:
        return jsonDouble(value.doubleValue());
      case BIG_DECIMAL:
        return jsonBigDecimal(value.decimalValue());
      default:
        throw new UnsupportedOperationException("Unsupported number type " + numberType);
    }
  }