com.atlassian.jira.jql.resolver
Class ProjectResolver

java.lang.Object
  extended by com.atlassian.jira.jql.resolver.ProjectResolver
All Implemented Interfaces:
NameResolver<Project>

@InjectableComponent
public class ProjectResolver
extends java.lang.Object
implements NameResolver<Project>

Resolves Project objects and ids from their names.

Since:
v4.0

Constructor Summary
ProjectResolver(ProjectManager projectManager)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Project get(java.lang.Long id)
          Get by id.
 java.util.Collection<Project> getAll()
          Gets all domain objects of this type in the underlying database.
 java.util.List<java.lang.String> getIdsFromName(java.lang.String name)
          Returns the list of ids of T objects that have the given name.
 int hashCode()
           
 boolean idExists(java.lang.Long id)
          Returns true if the id would resolve to a domain object.
 boolean nameExists(java.lang.String name)
          Returns true if the name would resolve to a domain object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectResolver

public ProjectResolver(ProjectManager projectManager)
Method Detail

getIdsFromName

public java.util.List<java.lang.String> getIdsFromName(java.lang.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<Project>
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(java.lang.String name)
Description copied from interface: NameResolver
Returns true if the name would resolve to a domain object.

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

idExists

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

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

get

public Project get(java.lang.Long id)
Description copied from interface: NameResolver
Get by id.

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

getAll

public java.util.Collection<Project> getAll()
Description copied from interface: NameResolver
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.

Specified by:
getAll in interface NameResolver<Project>
Returns:
all objects of the configured type in the database (possibly empty, never null).

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2002-2010 Atlassian. All Rights Reserved.