Code example for Supplier

Methods: get

0
   } 
 
   @Provides 
   @TimeStamp 
   protected Long provideTimeStamp(@TimeStamp Supplier<Long> cache) {
      return cache.get();
   } 
 
   /** 
    * borrowing concurrency code to ensure that caching takes place properly 
    */ 
   @Provides 
   @TimeStamp 
   Supplier<Long> provideTimeStampCache(@Named(PROPERTY_SESSION_INTERVAL) long seconds) {
      return Suppliers.memoizeWithExpiration(new Supplier<Long>() {
         public Long get() {
            return System.currentTimeMillis() / 1000;
         } 
      }, seconds, TimeUnit.SECONDS);
   } 
Experience pair programming with AI  Get Codota for Java