org.springframework.data.mapping.context

## Class MappingContextEvent<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>

- java.lang.Object
- - java.util.EventObject
  - - org.springframework.context.ApplicationEvent
    - - org.springframework.data.mapping.context.MappingContextEvent<E,P>

Type Parameters:
  `E` - the `PersistentEntity` the context was created for
  `P` - the `PersistentProperty` the `PersistentEntity` consists of

All Implemented Interfaces:
  Serializable

    public class MappingContextEvent<E extends PersistentEntity<?,P>,P extends PersistentProperty<P>>
    extends ApplicationEvent

Base implementation of an `ApplicationEvent` refering to a `PersistentEntity`.

Author:
  Oliver Gierke, Jon Brisbin
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`MappingContextEvent(MappingContext<?,?> source, E entity)` Creates a new `MappingContextEvent` for the given `MappingContext` and `PersistentEntity`.

### Method Summary

All Methods Instance Methods Concrete Methods
`E` `getPersistentEntity()` Returns the `PersistentEntity` the event was created for.
`boolean` `wasEmittedBy(MappingContext<?,?> context)` Returns whether the `MappingContextEvent` was triggered by the given `MappingContext`.

### Methods inherited from class org.springframework.context.ApplicationEvent

`getTimestamp`

### Methods inherited from class java.util.EventObject

`getSource, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MappingContextEvent

    public MappingContextEvent(MappingContext<?,?> source,
                               E entity)

Creates a new `MappingContextEvent` for the given `MappingContext` and `PersistentEntity`.

Parameters:
  `source` - must not be null.
  `entity` - must not be null.

### Method Detail

#### getPersistentEntity

    public E getPersistentEntity()

Returns the `PersistentEntity` the event was created for.

Returns:

#### wasEmittedBy

    public boolean wasEmittedBy(MappingContext<?,?> context)

Returns whether the `MappingContextEvent` was triggered by the given `MappingContext`.

Parameters:
  `context` - the `MappingContext` that potentially created the event.
Returns: