Example usage for org.springframework.data.redis.connection.lettuce LettuceConnectionProvider getClass

List of usage examples for org.springframework.data.redis.connection.lettuce LettuceConnectionProvider getClass

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection.lettuce LettuceConnectionProvider getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.data.redis.connection.lettuce.LettuceClusterConnection.java

/**
 * @return access to {@link RedisClusterClient} for non-connection access.
 *//*from   w w  w. j  av a2 s  .  c o m*/
private RedisClusterClient getClient() {

    LettuceConnectionProvider connectionProvider = getConnectionProvider();

    if (connectionProvider instanceof RedisClientProvider) {
        return (RedisClusterClient) ((RedisClientProvider) getConnectionProvider()).getRedisClient();
    }

    throw new IllegalStateException(
            String.format("Connection provider %s does not implement RedisClientProvider!",
                    connectionProvider.getClass().getName()));
}