class JsonUtil {

    private JsonUtil() {
    }

    /**
     * safe json type conversion
     *
     * @param key   redis key
     * @param clazz cast type
     * @param <T>
     * @return result type
     */
    public static <T> T redisJsonToObject(RedisTemplate<Object, Object> redisTemplate, String key, Class<T> clazz) {<FILL_FUNCTION_BODY>}
}

        Object jsonObject = redisTemplate.opsForValue().get(key);
        if (Objects.isNull(jsonObject)) {
            return null;
        }
        return clazz.cast(jsonObject);
    
<no_super_class>