mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-29 12:37:40 +01:00
Refactor CacheMetadata
This commit is contained in:
parent
4e9b11f30a
commit
3fae4e5e9e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user