Class CacheableProfileable
java.lang.Object
com.cryptomorin.xseries.profiles.objects.cache.CacheableProfileable
- All Implemented Interfaces:
Profileable
- Direct Known Subclasses:
TimedCacheableProfileable
Any
Profileable that can have its results cached.
This class should not be used directly.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.cryptomorin.xseries.profiles.objects.Profileable
Profileable.DynamicGameProfileProfileable, Profileable.PlayerProfileable, Profileable.PlayerProfileProfileable, Profileable.RawGameProfileProfileable, Profileable.StringProfileable, Profileable.UsernameProfileable, Profileable.UUIDProfileable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @NotNull com.mojang.authlib.GameProfilefinal com.mojang.authlib.GameProfileThis method should not be used directly unless you know what you're doing.final booleanprotected booleanhasExpired(boolean renew) final booleanisReady()Whether this profile has all the necessary information to construct itsProfileable.getProfile()right away.final StringtoString()Methods 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, prepare, test, transform
-
Field Details
-
cache
protected com.mojang.authlib.GameProfile cache -
lastError
-
-
Constructor Details
-
CacheableProfileable
public CacheableProfileable()
-
-
Method Details
-
getProfile
public final com.mojang.authlib.GameProfile getProfile()Description copied from interface:ProfileableThis method should not be used directly unless you know what you're doing.The texture which might be cached. If any errors occur, the check may be re-evaluated. The cached values might also be re-evaluated due to expiration.
- Specified by:
getProfilein interfaceProfileable- Returns:
- the original profile (not cloned if possible) for an instance that's always guaranteed to be a copy
you can use
Profileable.getDisposableProfile()instead. Null if no profile is set (only happens forProfileContainer).
-
hasExpired
public final boolean hasExpired()- Returns:
- true if this profile hasn't been cached yet or the cache is expired.
-
isReady
public final boolean isReady()Description copied from interface:ProfileableWhether this profile has all the necessary information to construct itsProfileable.getProfile()right away. When this method returns false, it means some kind of request has to be sent to Mojang servers in order to retrieve some information.Even if this method returns true, it doesn't necessarily mean that this profile has all information (textures, username, UUID, etc.) it merely means that it has all the information it needs in memory to compute its
Profileable.getProfile()and doesn't need to a request any data usingMinecraftClient.- Specified by:
isReadyin interfaceProfileable- See Also:
-
hasExpired
protected boolean hasExpired(boolean renew) -
cacheProfile
@NotNull protected abstract @NotNull com.mojang.authlib.GameProfile cacheProfile() -
toString
-