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, Johannes Englmeier
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the identifier.
    default Object
    Returns the identifier of the underlying instance.
  • Method Details

    • getIdentifier

      @Nullable Object getIdentifier()
      Returns the value of the identifier.
      Returns:
      the identifier of the underlying instance.
    • getRequiredIdentifier

      default Object getRequiredIdentifier()
      Returns the identifier of the underlying instance. Implementations are strongly recommended to extends either TargetAwareIdentifierAccessor 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