private int hash(final FindOptions options) { if (options == null) { return 0; } int result = options.getBatchSize(); result = 31 * result + getLimit(); result = 31 * result + (options.getModifiers() != null ? options.getModifiers().hashCode() : 0); result = 31 * result + (options.getProjection() != null ? options.getProjection().hashCode() : 0); result = 31 * result + (int) (options.getMaxTime(MILLISECONDS) ^ options.getMaxTime(MILLISECONDS) >>> 32); result = 31 * result + (int) (options.getMaxAwaitTime(MILLISECONDS) ^ options.getMaxAwaitTime(MILLISECONDS) >>> 32); result = 31 * result + options.getSkip(); result = 31 * result + (options.getSortDBObject() != null ? options.getSortDBObject().hashCode() : 0); result = 31 * result + (options.getCursorType() != null ? options.getCursorType().hashCode() : 0); result = 31 * result + (options.isNoCursorTimeout() ? 1 : 0); result = 31 * result + (options.isOplogReplay() ? 1 : 0); result = 31 * result + (options.isPartial() ? 1 : 0); result = 31 * result + (options.getReadPreference() != null ? options.getReadPreference().hashCode() : 0); result = 31 * result + (options.getReadConcern() != null ? options.getReadConcern().hashCode() : 0); result = 31 * result + (options.getCollation() != null ? options.getCollation().hashCode() : 0); return result; }