V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
poplar89
V2EX  ›  问与答

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

  •  
  •   poplar89 · Dec 9, 2019 · 2563 views
    This topic created in 2330 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   ·   849 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:53 · PVG 05:53 · LAX 14:53 · JFK 17:53
    ♥ Do have faith in what you're doing.