poplar89
V2EX  ›  问与答

Redis SessionCallback 的 execute 方法的泛型为何不能指定具体类型?

  •  
  •   poplar89 · Dec 9, 2019 · 2592 views
    This topic created in 2340 days ago, the information mentioned may be changed or developed.

    Redis SessionCallback 的 execute 方法的泛型为什么这么设计?这里的 K 和 V 为何不能指定具体类型?

    public void ttt(){
      redisTemplate.execute(new SessionCallback<Object>() {
        @Override
        public <K, V> Object execute(RedisOperations<K, V> operations) throws DataAccessException {
          return null;
        }
      });
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5739 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 03:46 · PVG 11:46 · LAX 20:46 · JFK 23:46
    ♥ Do have faith in what you're doing.