- All Implemented Interfaces:
Serializable,Comparable<RedisInstance.Role>,java.lang.constant.Constable
- Enclosing interface:
- RedisInstance
public static enum RedisInstance.Role extends Enum<RedisInstance.Role>
Possible Redis instance roles.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description booleanisMaster()booleanisReplica()booleanisUpstream()static RedisInstance.RolevalueOf(String name)Returns the enum constant of this type with the specified name.static RedisInstance.Role[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
MASTER
-
SLAVE
Deprecated. -
UPSTREAM
-
REPLICA
-
SENTINEL
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isMaster
public boolean isMaster()- Returns:
trueif the role indicates that the role is a replication source.- Since:
- 6.0
-
isUpstream
public boolean isUpstream()- Returns:
trueif the role indicates that the role is a replication source.- Since:
- 6.1
-
isReplica
public boolean isReplica()- Returns:
trueif the role indicates that the role is a replicated node (replica).- Since:
- 6.0
-