Class TimedCacheableProfileable

java.lang.Object
com.cryptomorin.xseries.profiles.objects.cache.CacheableProfileable
com.cryptomorin.xseries.profiles.objects.cache.TimedCacheableProfileable
All Implemented Interfaces:
Profileable
Direct Known Subclasses:
Profileable.DynamicGameProfileProfileable, Profileable.PlayerProfileable, Profileable.PlayerProfileProfileable, Profileable.StringProfileable, Profileable.UsernameProfileable, Profileable.UUIDProfileable

@Internal public abstract class TimedCacheableProfileable extends CacheableProfileable
Any Profileable that can have its results cached temporarily. This class should not be used directly.
  • Constructor Details

    • TimedCacheableProfileable

      public TimedCacheableProfileable()
  • Method Details

    • expiresAfter

      @NotNull protected @NotNull Duration expiresAfter()
      The amount of time the cached results of this profile can be used until it's re-evaluated. By default, it uses the internal cache's expiration date (6 hours). Negative durations should not be used. Duration.ZERO means that the cache never expires.
    • hasExpired

      public final boolean hasExpired(boolean renew)
      Overrides:
      hasExpired in class CacheableProfileable
      Parameters:
      renew - if this profile is expired, should we mark it as renewed?
      Returns:
      true if this profile hasn't been cached yet or the cache is expired.