mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-02-19 14:01:27 +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 {
|
public class CacheMetadata {
|
||||||
|
|
||||||
/**
|
|
||||||
* The cached data instance which creates this container
|
|
||||||
*/
|
|
||||||
private final AbstractCachedDataManager parentContainer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of the object which owns the cache
|
* The type of the object which owns the cache
|
||||||
*/
|
*/
|
||||||
@ -55,17 +50,12 @@ public class CacheMetadata {
|
|||||||
*/
|
*/
|
||||||
private final QueryOptions queryOptions;
|
private final QueryOptions queryOptions;
|
||||||
|
|
||||||
public CacheMetadata(AbstractCachedDataManager parentContainer, HolderType holderType, String objectName, QueryOptions queryOptions) {
|
public CacheMetadata(HolderType holderType, String objectName, QueryOptions queryOptions) {
|
||||||
this.parentContainer = parentContainer;
|
|
||||||
this.holderType = holderType;
|
this.holderType = holderType;
|
||||||
this.objectName = objectName;
|
this.objectName = objectName;
|
||||||
this.queryOptions = queryOptions;
|
this.queryOptions = queryOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractCachedDataManager getParentContainer() {
|
|
||||||
return this.parentContainer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HolderType getHolderType() {
|
public HolderType getHolderType() {
|
||||||
return this.holderType;
|
return this.holderType;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,6 @@ public class GroupCachedDataManager extends HolderCachedDataManager<Group> imple
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
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
|
@Override
|
||||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
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
|
@Override
|
||||||
protected CacheMetadata getMetadataForQueryOptions(QueryOptions queryOptions) {
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user