@Override public int hashCode() { // This is a work-around because JSONObject doesn't override hashCode(). // it will be quite expensive, but should suffice. return getRawJSON().toString().hashCode(); } }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SearchResult)) { return false; } final SearchResult other = (SearchResult) obj; // This is a work-around because JSONObject doesn't override equals(). // it will be quite expensive, but should suffice. return getRawJSON().toString().equals(other.getRawJSON().toString()); }
/** * Pretty print a SearchResult as an indented piece of JSON code. Throws a QuandlRuntimeException if it can't render the nested JSONObject * to a String. * * @param searchResult the searchResult, not null * @return a String representation of the object, probably multi-line. */ public static String toPrettyPrintedString(final SearchResult searchResult) { return toPrettyPrintedString(searchResult.getRawJSON()); }
/** * Load file using internal counter to generate file name and compare contents to the result provided. * @param searchResult the result to check file contents against */ public final void processResult(final SearchResult searchResult) { processResult(searchResult.getRawJSON()); }
/** * Save a SearchResult into a file in pretty printed format. * @param searchResult the JSON object to save */ public final void processResult(final SearchResult searchResult) { processResult(searchResult.getRawJSON()); }
/** * Save a SearchResult into a file in pretty printed format. * @param searchResult the JSON object to save */ public final void processResult(final SearchResult searchResult) { processResult(searchResult.getRawJSON()); }
/** * Load file using internal counter to generate file name and compare contents to the result provided. * @param searchResult the result to check file contents against */ public final void processResult(final SearchResult searchResult) { processResult(searchResult.getRawJSON()); }