Package com.atlassian.jira.jql.resolver
Interface NameResolver<T>
- All Known Subinterfaces:
UserResolver
- All Known Implementing Classes:
ComponentResolver,ConstantsNameResolver,CustomFieldOptionResolver,IssueTypeResolver,PriorityResolver,ProjectResolver,ResolutionResolver,ResolverManagerImpl.IssueSecurityLevelResolverFacade,StatusCategoryResolver,StatusResolver,UserResolverImpl,VersionResolver
public interface NameResolver<T>
Looks up domain objects from the database.
- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescriptionfindNonExistentIds(List<Long> ids) Find ids on passed list that do not exist.findNonExistentNames(List<String> names) Find names on passed list that do not exist.Get by id.getAll()Gets all domain objects of this type in the underlying database.getIdsFromName(String name) Returns the list of ids of T objects that have the given name.getIdsFromNames(List<String> names) Returns the list of ids of T objects that match any of given names.booleanReturns true if the id would resolve to a domain object.booleannameExists(String name) Returns true if the name would resolve to a domain object.
-
Method Details
-
getIdsFromName
Returns the list of ids of T objects that have the given name. Names may be unique but often are not, hence the List return type.- Parameters:
name- the name of the T.- Returns:
- all IDs of objects matching the name or the empty list on name lookup failure.
-
getIdsFromNames
Returns the list of ids of T objects that match any of given names. Names may be unique but often are not, hence the size of results might be greater that size of input. Default logic is provided for convenience, but allows specific resolvers to implement it more efficient- Parameters:
names- collection of names of the T.- Returns:
- all unique IDs of objects matching any of names or the empty list if nothing is found.
-
nameExists
Returns true if the name would resolve to a domain object.- Parameters:
name- the addressable name.- Returns:
- true only if the name resolves to a domain object in the database.
-
findNonExistentNames
Find names on passed list that do not exist.- Parameters:
names- the names to check.- Returns:
- the list of names that do not exist.
-
idExists
Returns true if the id would resolve to a domain object.- Parameters:
id- the primary key.- Returns:
- true only if the id resolves to a domain object in the database.
-
findNonExistentIds
Find ids on passed list that do not exist.- Parameters:
ids- the ids to check.- Returns:
- the list of ids that do not exist.
-
get
Get by id.- Parameters:
id- the id.- Returns:
- the domain object or null on lookup failure.
-
getAll
Gets all domain objects of this type in the underlying database. Note that calling this may not be a good idea for some domain object types.- Returns:
- all objects of the configured type in the database (possibly empty, never null).
-