mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-08 21:30:55 +02:00
Refactor CacheMetadata
This commit is contained in:
@@ -35,11 +35,6 @@ import net.luckperms.api.query.QueryOptions;
|
||||
*/
|
||||
public class CacheMetadata {
|
||||
|
||||
/**
|
||||
* The cached data instance which creates this container
|
||||
*/
|
||||
private final AbstractCachedDataManager parentContainer;
|
||||
|
||||
/**
|
||||
* The type of the object which owns the cache
|
||||
*/
|
||||
@@ -55,17 +50,12 @@ public class CacheMetadata {
|
||||
*/
|
||||
private final QueryOptions queryOptions;
|
||||
|
||||
public CacheMetadata(AbstractCachedDataManager parentContainer, HolderType holderType, String objectName, QueryOptions queryOptions) {
|
||||
this.parentContainer = parentContainer;
|
||||
public CacheMetadata(HolderType holderType, String objectName, QueryOptions queryOptions) {
|
||||
this.holderType = holderType;
|
||||
this.objectName = objectName;
|
||||
this.queryOptions = queryOptions;
|
||||
}
|
||||
|
||||
public AbstractCachedDataManager getParentContainer() {
|
||||
return this.parentContainer;
|
||||
}
|
||||
|
||||
public HolderType getHolderType() {
|
||||
return this.holderType;
|
||||
}
|
||||
|
@@ -42,6 +42,6 @@ public class GroupCachedDataManager extends HolderCachedDataManager<Group> imple
|
||||
|
||||
@Override
|
||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
||||
return new CacheMetadata(this, HolderType.GROUP, this.holder.getPlainDisplayName(), queryOptions);
|
||||
return new CacheMetadata(HolderType.GROUP, this.holder.getPlainDisplayName(), queryOptions);
|
||||
}
|
||||
}
|
||||
|
@@ -42,6 +42,6 @@ public class UserCachedDataManager extends HolderCachedDataManager<User> impleme
|
||||
|
||||
@Override
|
||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
||||
return new CacheMetadata(this, HolderType.USER, this.holder.getPlainDisplayName(), queryOptions);
|
||||
return new CacheMetadata(HolderType.USER, this.holder.getPlainDisplayName(), queryOptions);
|
||||
}
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ public class CalculatedSubjectCachedDataManager extends AbstractCachedDataManage
|
||||
|
||||
@Override
|
||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
||||
return new CacheMetadata(this, null, this.subject.getParentCollection().getIdentifier() + "/" + this.subject.getIdentifier(), queryOptions);
|
||||
return new CacheMetadata(null, this.subject.getParentCollection().getIdentifier() + "/" + this.subject.getIdentifier(), queryOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user