public void afterPropertiesSet() {
    if (!StringUtils.hasText(key)) {
      key = beanName;
    }

    Assert.hasText(key, "Collection key is required - no key or bean name specified");
    Assert.notNull(template, "Redis template is required");

    DataType dt = template.type(key);

    // can't create store
    Assert.isTrue(!DataType.STRING.equals(dt), "Cannot create store on keys of type 'string'");

    store = createStore(dt);

    if (store == null) {
      if (type == null) {
        type = CollectionType.LIST;
      }
      store = createStore(type.dataType());
    }
  }