Class ContextId
java.lang.Object
com.polarion.subterra.base.data.identification.ContextId
- All Implemented Interfaces:
IContextId
,Serializable
Sole implementation of
IContextId
.- Version:
- $Revision$ $Date$
- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Field Summary
FieldsFields inherited from interface com.polarion.subterra.base.data.identification.IContextId
BASELINE_DELIM, BASELINE_DELIM_CHAR, CLUSTER_END_DELIM, CLUSTER_END_DELIM_CHAR, CLUSTER_START_DELIM, CLUSTER_START_DELIM_CHAR
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return baseline (if any).Return cluster name (if any).static IContextId
getContextIdFromClusterAndContext
(String clusterName, String contextName) Return context id for given cluster and context.static IContextId
getContextIdFromClusterAndContextWithBaseline
(String clusterName, String contextName, String baseline) Return context id for given cluster and context.static IContextId
getContextIdFromContext
(String contextName) Return context id for given context and no cluster.static IContextId
getContextIdFromContextWithBaseline
(String contextName, String baseline) Return context id for given context and no cluster.static IContextId
getContextIdFromString
(String normId) Return context id for given normalized string representation.Return context name (if not global).static IContextId
Return global context id without cluster.static IContextId
getGlobalContextId
(String clusterName) Return global context id for given cluster.int
hashCode()
Remove baseline (if any) from this context id and return a new context id.Remove cluster name (if any) from this context id and return a new context id.setBaseline
(String baseline) Set baseline of this context id and return a new context id.setClusterName
(String clusterName) Set cluster name of this context id and return a new context id.Return the normalized string representation of this context id.toString()
-
Field Details
-
GLOBAL_ID
- See Also:
-
-
Method Details
-
getContextIdFromContext
Return context id for given context and no cluster.- Parameters:
contextName
- context name- Returns:
- context id
- Throws:
IllegalArgumentException
- if contextName isnull
-
getContextIdFromClusterAndContext
Return context id for given cluster and context.- Parameters:
clusterName
- cluster namecontextName
- context name- Returns:
- context id
- Throws:
IllegalArgumentException
- if clusterName isnull
IllegalArgumentException
- if contextName isnull
-
getContextIdFromContextWithBaseline
Return context id for given context and no cluster.- Parameters:
contextName
- context namebaseline
- baseline- Returns:
- context id
- Throws:
IllegalArgumentException
- if contextName isnull
IllegalArgumentException
- if baseline isnull
-
getContextIdFromClusterAndContextWithBaseline
public static IContextId getContextIdFromClusterAndContextWithBaseline(String clusterName, String contextName, String baseline) Return context id for given cluster and context.- Parameters:
clusterName
- cluster namecontextName
- context namebaseline
- baseline- Returns:
- context id
- Throws:
IllegalArgumentException
- if clusterName isnull
IllegalArgumentException
- if contextName isnull
IllegalArgumentException
- if baseline isnull
-
getGlobalContextId
Return global context id for given cluster.- Parameters:
clusterName
- cluster name- Returns:
- context id
- Throws:
IllegalArgumentException
- if clusterName isnull
-
getGlobalContextId
Return global context id without cluster.- Returns:
- context id
-
getContextIdFromString
Return context id for given normalized string representation.- Parameters:
normId
- normalized string representation- Returns:
- context id
- Throws:
IllegalArgumentException
- if normId isnull
-
getClusterName
Description copied from interface:IContextId
Return cluster name (if any).- Specified by:
getClusterName
in interfaceIContextId
- Returns:
- cluster name or
null
-
getContextName
Description copied from interface:IContextId
Return context name (if not global).- Specified by:
getContextName
in interfaceIContextId
- Returns:
- context name or
null
-
toNormalizedString
Description copied from interface:IContextId
Return the normalized string representation of this context id.- Specified by:
toNormalizedString
in interfaceIContextId
- Returns:
- normalized string
-
removeClusterName
Description copied from interface:IContextId
Remove cluster name (if any) from this context id and return a new context id.- Specified by:
removeClusterName
in interfaceIContextId
- Returns:
- new cluster-less context id
-
setClusterName
Description copied from interface:IContextId
Set cluster name of this context id and return a new context id.- Specified by:
setClusterName
in interfaceIContextId
- Parameters:
clusterName
- cluster name- Returns:
- new context id with cluster name
-
equals
-
hashCode
public int hashCode() -
toString
-
getBaseline
Description copied from interface:IContextId
Return baseline (if any).- Specified by:
getBaseline
in interfaceIContextId
- Returns:
- baseline or
null
-
removeBaseline
Description copied from interface:IContextId
Remove baseline (if any) from this context id and return a new context id.- Specified by:
removeBaseline
in interfaceIContextId
- Returns:
- new context id without baseline
-
setBaseline
Description copied from interface:IContextId
Set baseline of this context id and return a new context id.- Specified by:
setBaseline
in interfaceIContextId
- Parameters:
baseline
- baseline- Returns:
- new context id with baseline
-