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 TypeMethodDescriptionbooleanReturn baseline (if any).Return cluster name (if any).static IContextIdgetContextIdFromClusterAndContext(String clusterName, String contextName) Return context id for given cluster and context.static IContextIdgetContextIdFromClusterAndContextWithBaseline(String clusterName, String contextName, String baseline) Return context id for given cluster and context.static IContextIdgetContextIdFromContext(String contextName) Return context id for given context and no cluster.static IContextIdgetContextIdFromContextWithBaseline(String contextName, String baseline) Return context id for given context and no cluster.static IContextIdgetContextIdFromString(String normId) Return context id for given normalized string representation.Return context name (if not global).static IContextIdReturn global context id without cluster.static IContextIdgetGlobalContextId(String clusterName) Return global context id for given cluster.inthashCode()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 isnullIllegalArgumentException- 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 isnullIllegalArgumentException- 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 isnullIllegalArgumentException- if contextName isnullIllegalArgumentException- 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:IContextIdReturn cluster name (if any).- Specified by:
getClusterNamein interfaceIContextId- Returns:
- cluster name or
null
-
getContextName
Description copied from interface:IContextIdReturn context name (if not global).- Specified by:
getContextNamein interfaceIContextId- Returns:
- context name or
null
-
toNormalizedString
Description copied from interface:IContextIdReturn the normalized string representation of this context id.- Specified by:
toNormalizedStringin interfaceIContextId- Returns:
- normalized string
-
removeClusterName
Description copied from interface:IContextIdRemove cluster name (if any) from this context id and return a new context id.- Specified by:
removeClusterNamein interfaceIContextId- Returns:
- new cluster-less context id
-
setClusterName
Description copied from interface:IContextIdSet cluster name of this context id and return a new context id.- Specified by:
setClusterNamein interfaceIContextId- Parameters:
clusterName- cluster name- Returns:
- new context id with cluster name
-
equals
-
hashCode
public int hashCode() -
toString
-
getBaseline
Description copied from interface:IContextIdReturn baseline (if any).- Specified by:
getBaselinein interfaceIContextId- Returns:
- baseline or
null
-
removeBaseline
Description copied from interface:IContextIdRemove baseline (if any) from this context id and return a new context id.- Specified by:
removeBaselinein interfaceIContextId- Returns:
- new context id without baseline
-
setBaseline
Description copied from interface:IContextIdSet baseline of this context id and return a new context id.- Specified by:
setBaselinein interfaceIContextId- Parameters:
baseline- baseline- Returns:
- new context id with baseline
-