Interface EntityIdentifier
-
- All Superinterfaces:
Comparable<EntityIdentifier>
,ResourceIdentifier
,Serializable
- All Known Subinterfaces:
CompositeEntityIdentifier
,ExternalEntityIdentifier
- All Known Implementing Classes:
ExternalAccountIdentifier
,ExternalIntegerIdentifier
,ExternalStringIdentifier
,PdcAxisValuePk
,ReminderIdentifier
,UniqueIntegerIdentifier
,UniqueLongIdentifier
,UuidIdentifier
public interface EntityIdentifier extends ResourceIdentifier, Serializable, Comparable<EntityIdentifier>
All Silverpeas entities must use this interface for their identifier. By this way, all entities have a typed identifier that only the entity knows.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
compareTo(EntityIdentifier o)
Compares this identifier of entity with the specified one.EntityIdentifier
fromString(String id)
Sets the identifier's value from its given String representation.EntityIdentifier
generateNewId(String... parameters)
Generates a new unique entity identifier.-
Methods inherited from interface org.silverpeas.core.ResourceIdentifier
asString
-
-
-
-
Method Detail
-
fromString
EntityIdentifier fromString(String id)
Sets the identifier's value from its given String representation.- Parameters:
id
- the encoded value of the identifier.- Returns:
- the identifier decoded from the specified String representation.
-
generateNewId
EntityIdentifier generateNewId(String... parameters)
Generates a new unique entity identifier. "Auto-Increment" identifiers must implement this method.- Parameters:
parameters
- the parameters required in the generation of the new identifier. Those depends on the kind of entity identifier and they must be documented in the concrete class.- Returns:
- a new identifier.
-
compareTo
default int compareTo(EntityIdentifier o)
Compares this identifier of entity with the specified one. The comparing is done by their String representation.- Specified by:
compareTo
in interfaceComparable<EntityIdentifier>
- Parameters:
o
- another entity identifier.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- See Also:
Comparable.compareTo(Object)
-
-