Module spring.data.mongodb
Interface ReadPreferenceAware
- All Known Subinterfaces:
CursorPreparer,FindPublisherPreparer
- All Known Implementing Classes:
AggregationOptions,BasicQuery,MongoTemplate,NearQuery,Query,TextQuery
public interface ReadPreferenceAware
Interface to be implemented by any object that wishes to expose the
ReadPreference.
Typically implemented by cursor or query preparer objects.
- Since:
- 2.2
- Author:
- Christoph Strobl, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.ReadPreferencedefault boolean
-
Method Details
-
hasReadPreference
default boolean hasReadPreference()- Returns:
- true if a
ReadPreferenceis set.
-
getReadPreference
- Returns:
- the
ReadPreferenceto apply or null if none set.
-