public class IdConversions
extends java.lang.Object
Encoded database IDs are of the form:
<type code> <version identifier> <encoded ID part>
Where:
IdConversions.SupportedDataTypes
IdConversions.EncodingVersions
Background information:
| Modifier and Type | Class and Description |
|---|---|
static class |
IdConversions.EncodingVersions
The list of supported encoding format versions.
|
static class |
IdConversions.SupportedDataTypes
The list of data types supported for encoding/decoding.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
VER_A_CHARSET |
(package private) static java.lang.String |
VER_A_INVALID_CHARSET |
| Constructor and Description |
|---|
IdConversions() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsAnyChars(java.lang.String str,
java.lang.String chars)
Returns whether a string contains one or more characters.
|
static Pair<IdConversions.SupportedDataTypes,java.lang.Integer> |
decodeConentId(java.lang.String encodedId)
Decodes a previously encoded database ID.
|
static java.lang.String |
encodeContentId(IdConversions.SupportedDataTypes idType,
java.lang.String encodingVersion,
int dbId)
Encodes a datatbase ID
|
static final java.lang.String VER_A_CHARSET
static final java.lang.String VER_A_INVALID_CHARSET
public static boolean containsAnyChars(java.lang.String str,
java.lang.String chars)
str - String to checkchars - Characters to look for in strpublic static Pair<IdConversions.SupportedDataTypes,java.lang.Integer> decodeConentId(java.lang.String encodedId) throws java.lang.IllegalStateException
encodedId - Encoded database ID.Pair where the first member specifies the type of object and the second
member contains the decoded database ID.java.lang.IllegalStateException - If there is something invalid about encodedIdpublic static java.lang.String encodeContentId(IdConversions.SupportedDataTypes idType, java.lang.String encodingVersion, int dbId)
idType - The type of ID to encodeencodingVersion - The encoding version to usedbId - The database ID to encode