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
Any
Profileable that can have its results cached temporarily.
This class should not be used directly.-
Nested Class Summary
Nested classes/interfaces inherited from interface Profileable
Profileable.DynamicGameProfileProfileable, Profileable.PlayerProfileable, Profileable.PlayerProfileProfileable, Profileable.RawGameProfileProfileable, Profileable.StringProfileable, Profileable.UsernameProfileable, Profileable.UUIDProfileable -
Field Summary
Fields inherited from class CacheableProfileable
cache, lastError -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull DurationThe amount of time the cached results of this profile can be used until it's re-evaluated.final booleanhasExpired(boolean renew) Methods inherited from class CacheableProfileable
cacheProfile, getProfile, hasExpired, isReady, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Profileable
getDisposableProfile, getProfileValue, prepare, test, transform
-
Constructor Details
-
TimedCacheableProfileable
public TimedCacheableProfileable()
-
-
Method Details
-
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.ZEROmeans that the cache never expires. -
hasExpired
public final boolean hasExpired(boolean renew) - Overrides:
hasExpiredin classCacheableProfileable- 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.
-