package com.atlassian.stash.internal.maintenance;

import com.google.common.base.Supplier;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * A container to hold the latest status for maintenance tasks
 *
 * @since 3.5
 */
public interface MaintenanceTaskStatusSupplier extends Supplier<MaintenanceTaskStatus> {
    /**
     * @return the status of the latest task
     */
    @Nullable
    @Override
    MaintenanceTaskStatus get();

    /**
     * Set the status of the latest task
     *
     * @param status the new status
     */
    void set(@Nonnull MaintenanceTaskStatus status);
}
