public class Identifier
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCHEMA_URL_ASPECT
Schema URL for aspects.
|
static java.lang.String |
SCHEMA_URL_PERSON
Schema URL for persons.
|
static java.lang.String |
SCHEMA_URL_REFERENCE
Schema URL for references.
|
static java.lang.String |
SCHEMA_URL_USER
Schema URL for users.
|
Constructor and Description |
---|
Identifier(PDRType type,
int instance,
int project,
int object)
Constructor with single parts of the ID.
|
Identifier(java.lang.String id)
Constructor with PDR ID as String.
|
Identifier(java.lang.String type,
java.lang.String instance,
java.lang.String project,
java.lang.String object)
Constructor with single parts of the ID as Strings.
|
Modifier and Type | Method and Description |
---|---|
static Identifier |
create(java.lang.String idString)
At risk of getting a
null reference, this method can
be used to create an instance of this class when the validity of
the given idString is secured during runtime by another
mechanim. |
boolean |
equals(java.lang.Object obj) |
int |
getInstanceNumber()
Returns the instance ID.
|
int |
getObjectNumber()
Returns the object ID.
|
int |
getProjectNumber()
Returns the project ID.
|
java.lang.String |
getSchemaURL()
Returns the XML schema URL according to identifier's type.
|
PDRType |
getType()
Returns the PDR type.
|
int |
hashCode() |
java.lang.String |
toString() |
static PDRType |
typeFromString(java.lang.String prefix)
Translates the given prefix string to the corresponding PDR type.
|
public static final java.lang.String SCHEMA_URL_ASPECT
public static final java.lang.String SCHEMA_URL_PERSON
public static final java.lang.String SCHEMA_URL_USER
public static final java.lang.String SCHEMA_URL_REFERENCE
public Identifier(java.lang.String id) throws InvalidIdentifierException
id
- PDR ID.InvalidIdentifierException
- ID does not match pattern.public Identifier(java.lang.String type, java.lang.String instance, java.lang.String project, java.lang.String object) throws InvalidIdentifierException
type
- PDR object type.instance
- Instance ID.project
- Project ID.object
- Object ID.InvalidIdentifierException
- Combined ID does not match pattern.public Identifier(PDRType type, int instance, int project, int object) throws InvalidIdentifierException
type
- PDR object type.instance
- Instance ID.project
- Project ID.object
- Object ID.InvalidIdentifierException
- Combined ID does not match pattern.public final java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Other object.Object.equals(Object)
public final int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public final PDRType getType()
public final int getInstanceNumber()
public final int getProjectNumber()
public final int getObjectNumber()
public static PDRType typeFromString(java.lang.String prefix)
prefix
- Prefix.public final java.lang.String getSchemaURL()
public static Identifier create(java.lang.String idString)
null
reference, this method can
be used to create an instance of this class when the validity of
the given idString
is secured during runtime by another
mechanim.idString
- PDR ID in its String form.null
or an instance of this class.