poplar89
V2EX  ›  问与答

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

  •  
  •   poplar89 · Dec 9, 2019 · 2685 views
    This topic created in 2390 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   ·   5300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 07:36 · PVG 15:36 · LAX 00:36 · JFK 03:36
    ♥ Do have faith in what you're doing.