java.lang.Object
com.polarion.subterra.base.data.identification.ContextId
All Implemented Interfaces:
IContextId, Serializable

public final class ContextId extends Object implements IContextId, Serializable
Sole implementation of IContextId.
Version:
$Revision$ $Date$
Author:
Stepan Roh, Polarion Software
See Also:
  • Field Details

  • Method Details

    • getContextIdFromContext

      public static IContextId getContextIdFromContext(String contextName)
      Return context id for given context and no cluster.
      Parameters:
      contextName - context name
      Returns:
      context id
      Throws:
      IllegalArgumentException - if contextName is null
    • getContextIdFromClusterAndContext

      public static IContextId getContextIdFromClusterAndContext(String clusterName, String contextName)
      Return context id for given cluster and context.
      Parameters:
      clusterName - cluster name
      contextName - context name
      Returns:
      context id
      Throws:
      IllegalArgumentException - if clusterName is null
      IllegalArgumentException - if contextName is null
    • getContextIdFromContextWithBaseline

      public static IContextId getContextIdFromContextWithBaseline(String contextName, String baseline)
      Return context id for given context and no cluster.
      Parameters:
      contextName - context name
      baseline - baseline
      Returns:
      context id
      Throws:
      IllegalArgumentException - if contextName is null
      IllegalArgumentException - if baseline is null
    • getContextIdFromClusterAndContextWithBaseline

      public static IContextId getContextIdFromClusterAndContextWithBaseline(String clusterName, String contextName, String baseline)
      Return context id for given cluster and context.
      Parameters:
      clusterName - cluster name
      contextName - context name
      baseline - baseline
      Returns:
      context id
      Throws:
      IllegalArgumentException - if clusterName is null
      IllegalArgumentException - if contextName is null
      IllegalArgumentException - if baseline is null
    • getGlobalContextId

      @NotNull public static IContextId getGlobalContextId(String clusterName)
      Return global context id for given cluster.
      Parameters:
      clusterName - cluster name
      Returns:
      context id
      Throws:
      IllegalArgumentException - if clusterName is null
    • getGlobalContextId

      @NotNull public static IContextId getGlobalContextId()
      Return global context id without cluster.
      Returns:
      context id
    • getContextIdFromString

      public static IContextId getContextIdFromString(String normId)
      Return context id for given normalized string representation.
      Parameters:
      normId - normalized string representation
      Returns:
      context id
      Throws:
      IllegalArgumentException - if normId is null
    • getClusterName

      public String getClusterName()
      Description copied from interface: IContextId
      Return cluster name (if any).
      Specified by:
      getClusterName in interface IContextId
      Returns:
      cluster name or null
    • getContextName

      public String getContextName()
      Description copied from interface: IContextId
      Return context name (if not global).
      Specified by:
      getContextName in interface IContextId
      Returns:
      context name or null
    • toNormalizedString

      public String toNormalizedString()
      Description copied from interface: IContextId
      Return the normalized string representation of this context id.
      Specified by:
      toNormalizedString in interface IContextId
      Returns:
      normalized string
    • removeClusterName

      public IContextId 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 interface IContextId
      Returns:
      new cluster-less context id
    • setClusterName

      public IContextId setClusterName(String clusterName)
      Description copied from interface: IContextId
      Set cluster name of this context id and return a new context id.
      Specified by:
      setClusterName in interface IContextId
      Parameters:
      clusterName - cluster name
      Returns:
      new context id with cluster name
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBaseline

      public String getBaseline()
      Description copied from interface: IContextId
      Return baseline (if any).
      Specified by:
      getBaseline in interface IContextId
      Returns:
      baseline or null
    • removeBaseline

      public IContextId removeBaseline()
      Description copied from interface: IContextId
      Remove baseline (if any) from this context id and return a new context id.
      Specified by:
      removeBaseline in interface IContextId
      Returns:
      new context id without baseline
    • setBaseline

      public IContextId setBaseline(String baseline)
      Description copied from interface: IContextId
      Set baseline of this context id and return a new context id.
      Specified by:
      setBaseline in interface IContextId
      Parameters:
      baseline - baseline
      Returns:
      new context id with baseline