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

public final class LocalId extends Object implements ILocalId, Serializable
Sole implementation of ILocalId.
Author:
Stepan Roh, Polarion Software
See Also:
  • Method Details

    • getLocalIdWithContainerAndRevision

      public static ILocalId getLocalIdWithContainerAndRevision(String prototypeName, ILocalId containerId, String objectName, String revision)
      Return local id with container and revision.
      Parameters:
      prototypeName - prototype name
      containerId - container id
      objectName - object name
      revision - revision
      Returns:
      local id
      Throws:
      IllegalArgumentException - if prototypeName is null
      IllegalArgumentException - if containerId is null
      IllegalArgumentException - if objectName is null
      IllegalArgumentException - if revision is null
    • getLocalIdWithContainer

      public static ILocalId getLocalIdWithContainer(String prototypeName, ILocalId containerId, String objectName)
      Return local id with container and without revision.
      Parameters:
      prototypeName - prototype name
      containerId - container id
      objectName - object name
      Returns:
      local id
      Throws:
      IllegalArgumentException - if prototypeName is null
      IllegalArgumentException - if containerId is null
      IllegalArgumentException - if objectName is null
    • getLocalIdWithRevision

      public static ILocalId getLocalIdWithRevision(String prototypeName, String objectName, String revision)
      Return local id without container and with revision.
      Parameters:
      prototypeName - prototype name
      objectName - object name
      revision - revision
      Returns:
      local id
      Throws:
      IllegalArgumentException - if prototypeName is null
      IllegalArgumentException - if objectName is null
      IllegalArgumentException - if revision is null
    • getLocalId

      public static ILocalId getLocalId(String prototypeName, String objectName)
      Return local id without container and revision.
      Parameters:
      prototypeName - prototype name
      objectName - object name
      Returns:
      local id
      Throws:
      IllegalArgumentException - if prototypeName is null
      IllegalArgumentException - if objectName is null
    • getLocalIdFromString

      public static ILocalId getLocalIdFromString(String normId)
      Return local id for given normalized string representation.
      Parameters:
      normId - normalized string representation
      Returns:
      local id
      Throws:
      IllegalArgumentException - if normId is null
      IllegalArgumentException - if given string is not normalized string representation
    • getLocalIdFromPrototypeLessString

      public static ILocalId getLocalIdFromPrototypeLessString(String normId, LocalId.IPrototypeResolver resolver)
      Return local id for given prototype-less normalized string representation.
      Parameters:
      normId - normalized string representation
      resolver - prototype resolver
      Returns:
      local id
      Throws:
      IllegalArgumentException - if normId is null
      IllegalArgumentException - if resolver is null
      IllegalArgumentException - if given string is not prototype-less normalized string representation
    • getPrototypeName

      public String getPrototypeName()
      Description copied from interface: ILocalId
      Prototype name.
      Specified by:
      getPrototypeName in interface ILocalId
      Returns:
      prototype name
    • getContainerId

      public ILocalId getContainerId()
      Description copied from interface: ILocalId
      Container id (if any).
      Specified by:
      getContainerId in interface ILocalId
      Returns:
      local id of container or null
    • getObjectName

      public String getObjectName()
      Description copied from interface: ILocalId
      Object name.
      Specified by:
      getObjectName in interface ILocalId
      Returns:
      object name
    • getRevision

      public String getRevision()
      Description copied from interface: ILocalId
      Revision (if any).
      Specified by:
      getRevision in interface ILocalId
      Returns:
      object revision or null
    • removeRevision

      public ILocalId removeRevision()
      Description copied from interface: ILocalId
      Remove revision from this local id and return new local id.
      Specified by:
      removeRevision in interface ILocalId
      Returns:
      new local id
    • setRevision

      public ILocalId setRevision(String revision)
      Description copied from interface: ILocalId
      Set revision of this local id and return new local id.
      Specified by:
      setRevision in interface ILocalId
      Parameters:
      revision - If null, then returns local id without revision (same as ILocalId.removeRevision()).
      Returns:
      new local id
    • toNormalizedString

      public String toNormalizedString()
      Description copied from interface: ILocalId
      Return normalized string representation of this local id.
      Specified by:
      toNormalizedString in interface ILocalId
      Returns:
      normalized string
    • toPrototypeLessNormalizedString

      public String toPrototypeLessNormalizedString()
      Description copied from interface: ILocalId
      Return prototype-less normalized string representation of this local id.
      Specified by:
      toPrototypeLessNormalizedString in interface ILocalId
      Returns:
      normalized string
    • 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
    • isTemporary

      public boolean isTemporary()
      Description copied from interface: ILocalId
      Whether this local id is temporary (its object name has temporary prefix).
      Specified by:
      isTemporary in interface ILocalId
      Returns:
      true if this local id is temporary
    • setObjectName

      public ILocalId setObjectName(String objectName)
      Description copied from interface: ILocalId
      Set object name of this local id and return new local id.
      Specified by:
      setObjectName in interface ILocalId
      Parameters:
      objectName - object name
      Returns:
      new local id