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

public final class ObjectId extends Object implements IObjectId, Serializable
Author:
Stepan Roh, Polarion Software
See Also:
  • Method Details

    • getCrossContextObjectId

      public static IObjectId getCrossContextObjectId(IContextId contextId, ILocalId localId)
      Return cross-context object id for given context id and local id.
      Parameters:
      contextId - context id
      localId - local id
      Returns:
      object id
      Throws:
      IllegalArgumentException - if contextId is null
      IllegalArgumentException - if localId is null
    • getContextLessObjectId

      public static IObjectId getContextLessObjectId(ILocalId localId)
      Return context-less object id for given local id.
      Parameters:
      localId - local id
      Returns:
      object id
      Throws:
      IllegalArgumentException - if localId is null
    • getObjectIdFromString

      public static IObjectId getObjectIdFromString(String normId)
      Return object id for given normalized string representation.
      Parameters:
      normId - normalized string representation
      Returns:
      object id
      Throws:
      IllegalArgumentException - if normId is null
      IllegalArgumentException - if given string is not normalized string representation
    • getObjectIdFromPrototypeLessString

      public static IObjectId getObjectIdFromPrototypeLessString(String normId, LocalId.IPrototypeResolver resolver)
      Return object id for given prototype-less normalized string representation.
      Parameters:
      normId - normalized string representation
      resolver - prototype resolver
      Returns:
      object id
      Throws:
      IllegalArgumentException - if normId is null
      IllegalArgumentException - if resolver is null
      IllegalArgumentException - if given string is not prototype-less normalized string representation
    • getContextId

      public IContextId getContextId()
      Description copied from interface: IObjectId
      Context id (if any).
      Specified by:
      getContextId in interface IObjectId
      Returns:
      context id or null
    • getLocalId

      public ILocalId getLocalId()
      Description copied from interface: IObjectId
      Local id.
      Specified by:
      getLocalId in interface IObjectId
      Returns:
      local id
    • removeContextId

      public IObjectId removeContextId()
      Description copied from interface: IObjectId
      Remove context id (if any) from this object id and return new object id.
      Specified by:
      removeContextId in interface IObjectId
      Returns:
      new context-less object id
    • removeRevision

      @NotNull public IObjectId removeRevision()
      Description copied from interface: IObjectId
      Remove revision (if any) from this object id's local id and return new object id.
      Specified by:
      removeRevision in interface IObjectId
      Returns:
      new object id with revision removed from its local id
    • setContextId

      public IObjectId setContextId(IContextId contextId)
      Description copied from interface: IObjectId
      Set context id of this object id and return new object id.
      Specified by:
      setContextId in interface IObjectId
      Parameters:
      contextId - context id
      Returns:
      new cross-context object id
    • toNormalizedString

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

      public String toPrototypeLessNormalizedString()
      Description copied from interface: IObjectId
      Return prototype-less normalized string representation of this object id.
      Specified by:
      toPrototypeLessNormalizedString in interface IObjectId
      Returns:
      normalized string
    • equals

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

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

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

      public IObjectId setLocalId(ILocalId localId)
      Description copied from interface: IObjectId
      Set local id of this object id and return new object id
      Specified by:
      setLocalId in interface IObjectId
      Parameters:
      localId - local id
      Returns:
      new object id