All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.moznion.auto_refresh_cache.CacheWithScheduledFuture Maven / Gradle / Ivy

The newest version!
package net.moznion.auto_refresh_cache;

import java.util.Optional;
import java.util.concurrent.Future;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Cached value with {@link Future} which is scheduled task as async.
 *
 * @param  Type of cache value.
 */
@Data
@AllArgsConstructor(access = AccessLevel.PACKAGE)
public class CacheWithScheduledFuture {
    /**
     * Cached value.
     */
    T cached;

    /**
     * Future of scheduled task as async. The Future's get method will return the given result upon successful completion.
     */
    Optional> future;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy