private <H> HandlerRegistration doAdd(final Event.Type<H> type, final Object source, final H handler) { if (type == null) { throw new NullPointerException("Cannot add a handler with a null type"); } if (handler == null) { throw new NullPointerException("Cannot add a null handler"); } if (firingDepth > 0) { enqueueAdd(type, source, handler); } else { doAddNow(type, source, handler); } return new HandlerRegistration() { public void removeHandler() { doRemove(type, source, handler); } }; }
private <H> HandlerRegistration doAdd(final Event.Type<H> type, final Object source, final H handler) { if (type == null) { throw new NullPointerException("Cannot add a handler with a null type"); } if (handler == null) { throw new NullPointerException("Cannot add a null handler"); } if (firingDepth > 0) { enqueueAdd(type, source, handler); } else { doAddNow(type, source, handler); } return new HandlerRegistration() { public void removeHandler() { doRemove(type, source, handler); } }; }
private <H> HandlerRegistration doAdd(final Event.Type<H> type, final Object source, final H handler) { if (type == null) { throw new NullPointerException("Cannot add a handler with a null type"); } if (handler == null) { throw new NullPointerException("Cannot add a null handler"); } if (firingDepth > 0) { enqueueAdd(type, source, handler); } else { doAddNow(type, source, handler); } return new HandlerRegistration() { public void removeHandler() { doRemove(type, source, handler); } }; }
private <H> HandlerRegistration doAdd(final Event.Type<H> type, final Object source, final H handler) { if (type == null) { throw new NullPointerException("Cannot add a handler with a null type"); } if (handler == null) { throw new NullPointerException("Cannot add a null handler"); } if (firingDepth > 0) { enqueueAdd(type, source, handler); } else { doAddNow(type, source, handler); } return new HandlerRegistration() { public void removeHandler() { doRemove(type, source, handler); } }; }