Skip to content

Instantly share code, notes, and snippets.

@jeevan-patil
Created July 29, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeevan-patil/311ed7d87606c4a60df1aa78592c0c87 to your computer and use it in GitHub Desktop.
Save jeevan-patil/311ed7d87606c4a60df1aa78592c0c87 to your computer and use it in GitHub Desktop.
Generic EntityCreatedEvent class.
import org.springframework.context.ApplicationEvent;
public class EntityCreatedEvent<T> extends ApplicationEvent {
private T entity;
public EntityCreatedEvent(Object source, T entity) {
super(source);
this.entity = entity;
}
public T getEntity() {
return entity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment