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 {
/**
* 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;
}

View File

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

View File

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

View File

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