public class TCDURI extends Object implements ObjectSizeProvider
TCDURI
class is used to parse and create URIs that identify items for the Content Delivery system.
TCDURIs can be identified by the 'tcd:'
namespace.
This class implements CachedObject
to provide cached objects such as
BinaryMetaImpl
with an estimate of the size of instances of this class.
Modifier and Type | Field and Description |
---|---|
static TCDURI |
NULL_URI
Null URI.
|
protected static HashMap<String,Long> |
STRING_TO_TYPE |
protected static HashMap<Long,String> |
TYPE_TO_STRING |
static String |
URI_NAMESPACE
URI namespace.
|
Constructor and Description |
---|
TCDURI(int publicationId,
long itemType,
long itemId)
Create a new
TCDURI based on publicationId, itemType and itemId. |
TCDURI(int publicationId,
long itemType,
long[] itemIds)
Create a new
TCDURI based on publicationId, itemType and itemIds. |
TCDURI(int publicationId,
long itemType,
long[] itemIds,
String variantId) |
TCDURI(int publicationId,
long itemType,
long itemId,
String variantId) |
TCDURI(String uriString)
Create a new
TCDURI object from a String. |
TCDURI(TCMURI uri)
Create a TCDURI object from a
TCMURI . |
TCDURI(TCMURI uri,
String variantId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Compare two URI instances for equality.
|
long[] |
getCompositeItemId()
Get the itemIds if a composite key is used.
|
long |
getItemId()
Get the Item identifier.
|
long |
getItemType()
Get the type for this URI.
|
static long |
getItemTypeId(String typeString)
Get the ItemTypeId based on a type string.
|
String |
getItemTypeString()
Get the type for this URI as a human readable string.
|
static String |
getItemTypeString(long itemType)
Get an ItemType string for an ItemType Id.
|
int |
getObjectSize()
Estimates the size in bytes of this object and the objects that it owns.
|
int |
getPublicationId()
Get the Publication identifier.
|
String |
getVariantId() |
int |
hashCode()
Get the hashcode value of this URI.
|
String |
toString()
Convert the URI to a string.
|
public static final TCDURI NULL_URI
public static final String URI_NAMESPACE
public TCDURI(TCMURI uri)
TCMURI
.uri
- A URI within the 'tcm:'
namespacepublic TCDURI(TCMURI uri, String variantId)
uri
- A URI within the 'tcm:'
namespacevariantId
- the variant IDpublic TCDURI(int publicationId, long itemType, long itemId)
TCDURI
based on publicationId, itemType and itemId.publicationId
- Publication Id for this URI.itemType
- Type of the URI as defined in TCDItemTypes
.itemId
- Id for the item.TCDItemTypes
public TCDURI(int publicationId, long itemType, long itemId, String variantId)
public TCDURI(int publicationId, long itemType, long[] itemIds)
TCDURI
based on publicationId, itemType and itemIds.publicationId
- Publication Id for this URI.itemType
- Type of the URI as defined in TCDItemTypes
.itemIds
- long array containing one or more itemIds.TCDItemTypes
public TCDURI(int publicationId, long itemType, long[] itemIds, String variantId)
public TCDURI(String uriString) throws ParseException
TCDURI
object from a String.uriString
- String containing an unparsed TCDURI
.ParseException
- If the URI can't be parsed as a TCDURI
.public int getObjectSize()
getObjectSize
in interface ObjectSizeProvider
public int getPublicationId()
public long getItemId()
public long[] getCompositeItemId()
public long getItemType()
TCDItemTypes
public String getVariantId()
public String getItemTypeString()
TCDItemTypes
public String toString()
public boolean equals(Object other)
public int hashCode()
public static long getItemTypeId(String typeString)
typeString
- String containing the type.public static String getItemTypeString(long itemType)
itemType
- ItemType Id.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries