public enum MongoReadPreference extends Enum<MongoReadPreference>
ReadPreference
enumeration.Enum Constant and Description |
---|
DEFAULT
Default read preference.
|
NEAREST
Forces reads to a primary or a secondary.
|
PRIMARY
Forces read to the primary.
|
PRIMARY_PREFERRED
Forces reads to the primary if available, otherwise to a secondary.
|
SECONDARY
Forces reads to a secondary.
|
SECONDARY_PREFERRED
Forces reads to a secondary if one is available, otherwise to the primary.
|
Modifier and Type | Method and Description |
---|---|
Optional<com.mongodb.ReadPreference> |
getReadPreference()
Get the actual
ReadPreference implementation, if available. |
static MongoReadPreference |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MongoReadPreference[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MongoReadPreference DEFAULT
public static final MongoReadPreference PRIMARY
public static final MongoReadPreference PRIMARY_PREFERRED
public static final MongoReadPreference SECONDARY
public static final MongoReadPreference SECONDARY_PREFERRED
public static final MongoReadPreference NEAREST
public static MongoReadPreference[] values()
for (MongoReadPreference c : MongoReadPreference.values()) System.out.println(c);
public static MongoReadPreference valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2019 The Holon Platform. All rights reserved.