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.GameProfileProfileable,Profileable.PlayerProfileable,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 com.cryptomorin.xseries.profiles.objects.Profileable
Profileable.GameProfileProfileable, Profileable.PlayerProfileable, Profileable.StringProfileable, Profileable.UsernameProfileable, Profileable.UUIDProfileable -
Field Summary
Fields inherited from class com.cryptomorin.xseries.profiles.objects.cache.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 com.cryptomorin.xseries.profiles.objects.cache.CacheableProfileable
getProfile, getProfile0, hasExpired, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.cryptomorin.xseries.profiles.objects.Profileable
getDisposableProfile, getProfileValue, 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)Duration.ZEROor negative durations should not be used. -
hasExpired
public final boolean hasExpired(boolean renew) - Overrides:
hasExpiredin classCacheableProfileable- Returns:
- true if this profile hasn't been cached yet or the cache is expired.
-