Package io.lettuce.core.models.role
Enum RedisInstance.Role
- java.lang.Object
-
- java.lang.Enum<RedisInstance.Role>
-
- io.lettuce.core.models.role.RedisInstance.Role
-
- All Implemented Interfaces:
Serializable
,Comparable<RedisInstance.Role>
- Enclosing interface:
- RedisInstance
public static enum RedisInstance.Role extends Enum<RedisInstance.Role>
Possible Redis instance roles.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isMaster()
boolean
isReplica()
boolean
isUpstream()
static RedisInstance.Role
valueOf(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 Detail
-
MASTER
public static final RedisInstance.Role MASTER
-
SLAVE
@Deprecated public static final RedisInstance.Role SLAVE
Deprecated.
-
UPSTREAM
public static final RedisInstance.Role UPSTREAM
-
REPLICA
public static final RedisInstance.Role REPLICA
-
SENTINEL
public static final RedisInstance.Role SENTINEL
-
-
Method Detail
-
values
public static RedisInstance.Role[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RedisInstance.Role c : RedisInstance.Role.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RedisInstance.Role valueOf(String name)
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:
true
if the role indicates that the role is a replication source.- Since:
- 6.0
-
isUpstream
public boolean isUpstream()
- Returns:
true
if the role indicates that the role is a replication source.- Since:
- 6.1
-
isReplica
public boolean isReplica()
- Returns:
true
if the role indicates that the role is a replicated node (replica).- Since:
- 6.0
-
-