class JsonSerdeUtils {

  static long toLong(final JsonNode object) {
    if (object instanceof NumericNode) {
      return object.asLong();
    }
    if (object instanceof TextNode) {
      try {
        return Long.parseLong(object.textValue());
      } catch (final NumberFormatException e) {
        throw failedStringCoercionException(SqlBaseType.BIGINT);
      }
    }
    throw invalidConversionException(object, SqlBaseType.BIGINT);
  }

  private  JsonSerdeUtils();

}