public class Identifier
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCHEMA_URL_ASPECT
XML Schema URL: Aspects.
|
static java.lang.String |
SCHEMA_URL_PERSON
XML Schema URL: Persons.
|
static java.lang.String |
SCHEMA_URL_REFERENCE
XML Schema URL: References.
|
static java.lang.String |
SCHEMA_URL_USER
XML Schema URL: Repository Users.
|
Constructor and Description |
---|
Identifier(PDRType type,
int instance,
int project,
int object)
Constructor with separated components.
|
Identifier(java.lang.String id)
Constructor with ID as
java.lang.String . |
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 other
mechanims. |
boolean |
equals(java.lang.Object otherObject) |
int |
getInstanceNumber()
Returns the instance ID of the identifier.
|
int |
getObjectNumber()
Returns the object ID of the identifier.
|
int |
getProjectNumber()
Returns the project ID of the identifier.
|
java.lang.String |
getSchemaURL()
Returns the URL linked to the provided PDR type as a
java.lang.String . |
PDRType |
getType()
Returns the PDR type of the identifier.
|
int |
hashCode() |
static java.lang.String |
intToHexString(int value,
int length)
Converts the provided value to a hex string of the given length.
|
org.bbaw.pdr.padre.request.PadreID |
toPadreID()
Converts this PDR identifier to a PaDRe identifier.
|
java.lang.String |
toString() |
static PDRType |
typeFromString(java.lang.String prefix)
Converts the provided prefix to a
org.bbaw.pdr.utils.PDRType . |
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 ValidationException
java.lang.String
.id
- PDR ID in common format.ValidationException
- Invalid ID.public Identifier(PDRType type, int instance, int project, int object) throws ValidationException
type
- PDR type.instance
- Instance ID.project
- Project ID.object
- Object ID.ValidationException
- Resulting ID is not valid.public final java.lang.String toString()
toString
in class java.lang.Object
String.toString()
public final boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
otherObject
- 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)
org.bbaw.pdr.utils.PDRType
.prefix
- Prefix.public final java.lang.String getSchemaURL()
java.lang.String
.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 other
mechanims.idString
- PDR ID as string.null
or an instance of this class.public final org.bbaw.pdr.padre.request.PadreID toPadreID() throws ValidationException
ValidationException
- Invalid PaDRe identifier.public static java.lang.String intToHexString(int value, int length)
value
- Value to convert.length
- Length of the resulting string.