#nullable disable
using System;
namespace StardewModdingAPI.Web.Framework.Caching
{
/// A cache entry.
/// The cached value type.
internal class Cached
{
/*********
** Accessors
*********/
/// The cached data.
public T Data { get; set; }
/// When the data was last updated.
public DateTimeOffset LastUpdated { get; set; }
/// When the data was last requested through the mod API.
public DateTimeOffset LastRequested { get; set; }
/*********
** Public methods
*********/
/// Construct an empty instance.
public Cached() { }
/// Construct an instance.
/// The cached data.
public Cached(T data)
{
this.Data = data;
this.LastUpdated = DateTimeOffset.UtcNow;
this.LastRequested = DateTimeOffset.UtcNow;
}
}
}