com.atlassian.jira.jql.resolver
Class ConstantsNameResolver<T>

java.lang.Object
  extended by com.atlassian.jira.jql.resolver.ConstantsNameResolver<T>
All Implemented Interfaces:
NameResolver<T>
Direct Known Subclasses:
IssueTypeResolver, PriorityResolver, ResolutionResolver, StatusResolver

public abstract class ConstantsNameResolver<T>
extends Object
implements NameResolver<T>

Common base class for issue constants providing most of the resolution logic.

Since:
v4.0

Constructor Summary
ConstantsNameResolver(ConstantsManager constantsManager, String constantName)
           
 
Method Summary
 T get(Long id)
          Get by id.
 List<String> getIdsFromName(String name)
          Returns the list of ids of T objects that have the given name.
 boolean idExists(Long id)
          Returns true if the id would resolve to a domain object.
 boolean nameExists(String name)
          Returns true if the name would resolve to a domain object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.jql.resolver.NameResolver
getAll
 

Constructor Detail

ConstantsNameResolver

public ConstantsNameResolver(ConstantsManager constantsManager,
                             String constantName)
Method Detail

getIdsFromName

public List<String> getIdsFromName(String name)
Description copied from interface: NameResolver
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.

Specified by:
getIdsFromName in interface NameResolver<T>
Parameters:
name - the name of the T.
Returns:
all IDs of objects matching the name or the empty list on name lookup failure.

nameExists

public boolean nameExists(String name)
Description copied from interface: NameResolver
Returns true if the name would resolve to a domain object.

Specified by:
nameExists in interface NameResolver<T>
Parameters:
name - the addressable name.
Returns:
true only if the name resolves to a domain object in the database.

idExists

public boolean idExists(Long id)
Description copied from interface: NameResolver
Returns true if the id would resolve to a domain object.

Specified by:
idExists in interface NameResolver<T>
Parameters:
id - the primary key.
Returns:
true only if the id resolves to a domain object in the database.

get

public T get(Long id)
Description copied from interface: NameResolver
Get by id.

Specified by:
get in interface NameResolver<T>
Parameters:
id - the id.
Returns:
the domain object or null on lookup failure.


Copyright © 2002-2014 Atlassian. All Rights Reserved.