001package gu.dtalk.event; 002 003import java.util.EventObject; 004 005import gu.dtalk.BaseItem; 006import static com.google.common.base.Preconditions.*; 007 008/** 009 * 事件父类 010 * @author guyadong 011 * 012 */ 013public class ItemEvent<T extends BaseItem> extends EventObject { 014 015 private static final long serialVersionUID = 5726171993308275693L; 016 017 public ItemEvent(T source) { 018 super(checkNotNull(source,"source is null ")); 019 } 020 @SuppressWarnings("unchecked") 021 public T item(){ 022 return (T) getSource(); 023 } 024}