Refactor CacheMetadata

This commit is contained in:
Luck 2019-12-29 18:34:55 +00:00
parent 4e9b11f30a
commit 3fae4e5e9e
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
4 changed files with 4 additions and 14 deletions

View File

@ -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;
} }

View File

@ -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);
} }
} }

View File

@ -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);
} }
} }

View File

@ -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