poplar89
V2EX  ›  问与答

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

  •  
  •   poplar89 · Dec 9, 2019 · 2723 views
    This topic created in 2407 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   ·   4865 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:04 · PVG 12:04 · LAX 21:04 · JFK 00:04
    ♥ Do have faith in what you're doing.