org.springframework.data.repository.core

## Interface EntityInformation<T,ID>

All Superinterfaces:
  EntityMetadata<T>

All Known Implementing Classes:
  AbstractEntityInformation, DelegatingEntityInformation, PersistentEntityInformation

    public interface EntityInformation<T,ID>
    extends EntityMetadata<T>

Extension of `EntityMetadata` to add functionality to query information of entity instances.

Author:
  Oliver Gierke, Mark Paluch
See Also:
  `PersistentEntityInformation`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`ID` `getId(T entity)` Returns the id of the given entity or null if none can be obtained.
`Class<ID>` `getIdType()` Returns the type of the id of the entity.
`default ID` `getRequiredId(T entity)` Returns the identifier of the given entity.
`boolean` `isNew(T entity)` Returns whether the given entity is considered to be new.

### Methods inherited from interface org.springframework.data.repository.core.EntityMetadata

`getJavaType`

### Method Detail

#### isNew

    boolean isNew(T entity)

Returns whether the given entity is considered to be new.

Parameters:
  `entity` - must never be null
Returns:

#### getId

    @Nullable
    ID getId(T entity)

Returns the id of the given entity or null if none can be obtained.

Parameters:
  `entity` - must never be null
Returns:

#### getRequiredId

    default ID getRequiredId(T entity)
                      throws IllegalArgumentException

Returns the identifier of the given entity.

Parameters:
  `entity` - must not be null.
Returns:
  the identifier of the given entity
Throws:
  `IllegalArgumentException` - in case no id could be obtained from the given entity
Since:
  2.0

#### getIdType

    Class<ID> getIdType()

Returns the type of the id of the entity.

Returns: