boolean hasHint() { return getModifiers().get("$indexHint") != null; } }
boolean isSnapshot() { Object snapshot = getModifiers().get("$snapshot"); return snapshot != null ? (Boolean) snapshot : false; }
@Override @Deprecated public Query<T> disableSnapshotMode() { getOptions().getModifiers().removeField("$snapshot"); return this; }
@Override @Deprecated public Query<T> returnKey() { getOptions().getModifiers().put("$returnKey", true); return this; }
long getMaxTime(final TimeUnit unit) { Long maxTime = (Long) getOptions().getModifiers().get("$maxTimeMS"); return unit.convert(maxTime != null ? maxTime : 0, MILLISECONDS); }
@Override @Deprecated public Query<T> upperIndexBound(final DBObject upperBound) { if (upperBound != null) { getOptions().getModifiers().put("$max", new BasicDBObject(upperBound.toMap())); } return this; }
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; }