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 interfacePrototype 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 TypeMethodDescriptionbooleanContainer id (if any).static ILocalIdgetLocalId(String prototypeName, String objectName) Return local id without container and revision.static ILocalIdgetLocalIdFromPrototypeLessString(String normId, LocalId.IPrototypeResolver resolver) Return local id for given prototype-less normalized string representation.static ILocalIdgetLocalIdFromString(String normId) Return local id for given normalized string representation.static ILocalIdgetLocalIdWithContainer(String prototypeName, ILocalId containerId, String objectName) Return local id with container and without revision.static ILocalIdgetLocalIdWithContainerAndRevision(String prototypeName, ILocalId containerId, String objectName, String revision) Return local id with container and revision.static ILocalIdgetLocalIdWithRevision(String prototypeName, String objectName, String revision) Return local id without container and with revision.Object name.Prototype name.Revision (if any).inthashCode()booleanWhether 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 isnullIllegalArgumentException- if containerId isnullIllegalArgumentException- if objectName isnullIllegalArgumentException- 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 isnullIllegalArgumentException- if containerId isnullIllegalArgumentException- 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 isnullIllegalArgumentException- if objectName isnullIllegalArgumentException- if revision isnull
-
getLocalId
Return local id without container and revision.- Parameters:
prototypeName- prototype nameobjectName- object name- Returns:
- local id
- Throws:
IllegalArgumentException- if prototypeName isnullIllegalArgumentException- if objectName isnull
-
getLocalIdFromString
Return local id for given normalized string representation.- Parameters:
normId- normalized string representation- Returns:
- local id
- Throws:
IllegalArgumentException- if normId isnullIllegalArgumentException- 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 isnullIllegalArgumentException- if resolver isnullIllegalArgumentException- if given string is not prototype-less normalized string representation
-
getPrototypeName
Description copied from interface:ILocalIdPrototype name.- Specified by:
getPrototypeNamein interfaceILocalId- Returns:
- prototype name
-
getContainerId
Description copied from interface:ILocalIdContainer id (if any).- Specified by:
getContainerIdin interfaceILocalId- Returns:
- local id of container or
null
-
getObjectName
Description copied from interface:ILocalIdObject name.- Specified by:
getObjectNamein interfaceILocalId- Returns:
- object name
-
getRevision
Description copied from interface:ILocalIdRevision (if any).- Specified by:
getRevisionin interfaceILocalId- Returns:
- object revision or
null
-
removeRevision
Description copied from interface:ILocalIdRemove revision from this local id and return new local id.- Specified by:
removeRevisionin interfaceILocalId- Returns:
- new local id
-
setRevision
Description copied from interface:ILocalIdSet revision of this local id and return new local id.- Specified by:
setRevisionin interfaceILocalId- Parameters:
revision- Ifnull, then returns local id without revision (same asILocalId.removeRevision()).- Returns:
- new local id
-
toNormalizedString
Description copied from interface:ILocalIdReturn normalized string representation of this local id.- Specified by:
toNormalizedStringin interfaceILocalId- Returns:
- normalized string
-
toPrototypeLessNormalizedString
Description copied from interface:ILocalIdReturn prototype-less normalized string representation of this local id.- Specified by:
toPrototypeLessNormalizedStringin interfaceILocalId- Returns:
- normalized string
-
equals
-
hashCode
public int hashCode() -
toString
-
isTemporary
public boolean isTemporary()Description copied from interface:ILocalIdWhether this local id is temporary (its object name has temporary prefix).- Specified by:
isTemporaryin interfaceILocalId- Returns:
trueif this local id is temporary
-
setObjectName
Description copied from interface:ILocalIdSet object name of this local id and return new local id.- Specified by:
setObjectNamein interfaceILocalId- Parameters:
objectName- object name- Returns:
- new local id
-