Class LocalId
java.lang.Object
com.polarion.subterra.base.data.identification.LocalId
- All Implemented Interfaces:
ILocalId
,Serializable
Sole implementation of
ILocalId
.- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Prototype resolver used ingetLocalIdFromPrototypeLessString(String, IPrototypeResolver)
. -
Field Summary
Fields inherited from interface com.polarion.subterra.base.data.identification.ILocalId
CONTAINER_DELIM, CONTAINER_DELIM_CHAR, PROTOTYPE_END_DELIM, PROTOTYPE_END_DELIM_CHAR, PROTOTYPE_START_DELIM, PROTOTYPE_START_DELIM_CHAR, REVISION_DELIM, REVISION_DELIM_CHAR, TEMPORARY_OBJECT_NAME_PREFIX, TEMPORARY_OBJECT_NAME_PREFIX_CHAR
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Container id (if any).static ILocalId
getLocalId
(String prototypeName, String objectName) Return local id without container and revision.static ILocalId
getLocalIdFromPrototypeLessString
(String normId, LocalId.IPrototypeResolver resolver) Return local id for given prototype-less normalized string representation.static ILocalId
getLocalIdFromString
(String normId) Return local id for given normalized string representation.static ILocalId
getLocalIdWithContainer
(String prototypeName, ILocalId containerId, String objectName) Return local id with container and without revision.static ILocalId
getLocalIdWithContainerAndRevision
(String prototypeName, ILocalId containerId, String objectName, String revision) Return local id with container and revision.static ILocalId
getLocalIdWithRevision
(String prototypeName, String objectName, String revision) Return local id without container and with revision.Object name.Prototype name.Revision (if any).int
hashCode()
boolean
Whether this local id is temporary (its object name has temporary prefix).Remove revision from this local id and return new local id.setObjectName
(String objectName) Set object name of this local id and return new local id.setRevision
(String revision) Set revision of this local id and return new local id.Return normalized string representation of this local id.Return prototype-less normalized string representation of this local id.toString()
-
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 namecontainerId
- container idobjectName
- object namerevision
- revision- Returns:
- local id
- Throws:
IllegalArgumentException
- if prototypeName isnull
IllegalArgumentException
- if containerId isnull
IllegalArgumentException
- if objectName isnull
IllegalArgumentException
- if revision isnull
-
getLocalIdWithContainer
public static ILocalId getLocalIdWithContainer(String prototypeName, ILocalId containerId, String objectName) Return local id with container and without revision.- Parameters:
prototypeName
- prototype namecontainerId
- container idobjectName
- object name- Returns:
- local id
- Throws:
IllegalArgumentException
- if prototypeName isnull
IllegalArgumentException
- if containerId isnull
IllegalArgumentException
- if objectName isnull
-
getLocalIdWithRevision
public static ILocalId getLocalIdWithRevision(String prototypeName, String objectName, String revision) Return local id without container and with revision.- Parameters:
prototypeName
- prototype nameobjectName
- object namerevision
- revision- Returns:
- local id
- Throws:
IllegalArgumentException
- if prototypeName isnull
IllegalArgumentException
- if objectName isnull
IllegalArgumentException
- if revision isnull
-
getLocalId
Return local id without container and revision.- Parameters:
prototypeName
- prototype nameobjectName
- object name- Returns:
- local id
- Throws:
IllegalArgumentException
- if prototypeName isnull
IllegalArgumentException
- if objectName isnull
-
getLocalIdFromString
Return local id for given normalized string representation.- Parameters:
normId
- normalized string representation- Returns:
- local id
- Throws:
IllegalArgumentException
- if normId isnull
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 representationresolver
- prototype resolver- Returns:
- local id
- Throws:
IllegalArgumentException
- if normId isnull
IllegalArgumentException
- if resolver isnull
IllegalArgumentException
- if given string is not prototype-less normalized string representation
-
getPrototypeName
Description copied from interface:ILocalId
Prototype name.- Specified by:
getPrototypeName
in interfaceILocalId
- Returns:
- prototype name
-
getContainerId
Description copied from interface:ILocalId
Container id (if any).- Specified by:
getContainerId
in interfaceILocalId
- Returns:
- local id of container or
null
-
getObjectName
Description copied from interface:ILocalId
Object name.- Specified by:
getObjectName
in interfaceILocalId
- Returns:
- object name
-
getRevision
Description copied from interface:ILocalId
Revision (if any).- Specified by:
getRevision
in interfaceILocalId
- Returns:
- object revision or
null
-
removeRevision
Description copied from interface:ILocalId
Remove revision from this local id and return new local id.- Specified by:
removeRevision
in interfaceILocalId
- Returns:
- new local id
-
setRevision
Description copied from interface:ILocalId
Set revision of this local id and return new local id.- Specified by:
setRevision
in interfaceILocalId
- Parameters:
revision
- Ifnull
, then returns local id without revision (same asILocalId.removeRevision()
).- Returns:
- new local id
-
toNormalizedString
Description copied from interface:ILocalId
Return normalized string representation of this local id.- Specified by:
toNormalizedString
in interfaceILocalId
- Returns:
- normalized string
-
toPrototypeLessNormalizedString
Description copied from interface:ILocalId
Return prototype-less normalized string representation of this local id.- Specified by:
toPrototypeLessNormalizedString
in interfaceILocalId
- Returns:
- normalized string
-
equals
-
hashCode
public int hashCode() -
toString
-
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 interfaceILocalId
- Returns:
true
if this local id is temporary
-
setObjectName
Description copied from interface:ILocalId
Set object name of this local id and return new local id.- Specified by:
setObjectName
in interfaceILocalId
- Parameters:
objectName
- object name- Returns:
- new local id
-