Package org.springframework.data.mapping
Interface IdentifierAccessor
- All Known Implementing Classes:
IdPropertyIdentifierAccessor
,TargetAwareIdentifierAccessor
public interface IdentifierAccessor
Interface for a component allowing the access of identifier values.
- Author:
- Oliver Gierke, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the identifier.default Object
Returns the identifier of the underlying instance.
-
Method Details
-
getIdentifier
Returns the value of the identifier.- Returns:
- the identifier of the underlying instance.
-
getRequiredIdentifier
Returns the identifier of the underlying instance. Implementations are strongly recommended to extends eitherTargetAwareIdentifierAccessor
or override this method to add more context to the exception being thrown in case of the absence of an identifier.- Returns:
- the identifier of the underlying instance
- Throws:
IllegalStateException
- in case no identifier could be retrieved.- Since:
- 2.0
-