@InjectableComponent public class

JqlIssueKeySupportImpl

extends Object
implements JqlIssueKeySupport
java.lang.Object
   ↳ com.atlassian.jira.jql.util.JqlIssueKeySupportImpl

Class Overview

Default implementation of the JqlIssueKeySupport interface.

Summary

Public Constructors
JqlIssueKeySupportImpl()
Public Methods
boolean isValidIssueKey(String issueKey)
Determines is the passed issue key is valid for JIRA.
long parseKeyNum(String issueKey)
Return the numeric part of the issue key.
String parseProjectKey(String issueKey)
Return the project key part of the issue key.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.jql.util.JqlIssueKeySupport

Public Constructors

public JqlIssueKeySupportImpl ()

Public Methods

public boolean isValidIssueKey (String issueKey)

Determines is the passed issue key is valid for JIRA. It does *NOT* determine if the issue actually exists within JIRA.

Parameters
issueKey the issue key to validate. Null will be considered an invalid key.
Returns
  • true if the passed key is valid or false otherwise.

public long parseKeyNum (String issueKey)

Return the numeric part of the issue key. Assumes that the passed key is valid. The method will return -1 on a parsing error, however, this cannot be used to determine if a key is valid as some invalid keys may parse correctly. The isValidIssueKey(String) method can be used to determine if a key is invalid or not.

Parameters
issueKey the issue key to parse. A null key will return -1.
Returns
  • the numeric part of the key. Will return -1 to indicate a parsing error.

public String parseProjectKey (String issueKey)

Return the project key part of the issue key. Assumes that the passed key is valid. The method will return null on a parsing error, however, this cannot be used to determine if a key is valid as some invalid keys may parrse correctly. The isValidIssueKey(String) method can be used to determine if a key is invalid or not.

Parameters
issueKey the issue key to parse. A null key will return null.
Returns
  • the project key part of the issue key, or null on a parsing error.