// Path: mvvm-life-cycle/src/main/java/me/henrytao/mvvmlifecycle/event/Event.java
// public interface Event extends Action1<Object> {
// 
// }


import android.text.TextUtils;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import me.henrytao.mvvmlifecycle.event.Event;
import rx.Subscription;
import rx.functions.Action1;
import rx.subjects.PublishSubject;
    }
  }

  public void dispatch(Enum eventName, Object... objects) {
    dispatch(eventName.toString(), objects);
  }

  public void dispatch(String eventName, Object... objects) {
    if (sEventSubject.containsKey(eventName)) {
      sEventSubject.get(eventName).onNext(objects);
    }
  }

  public void register(Object owner, Enum event) {
    register(owner, event.toString());
  }

  public void register(Object owner, String eventName) {
    String ownerClassName = owner.getClass().toString();
    if (sRegisteredEvents.containsKey(eventName)) {
      if (!TextUtils.equals(sRegisteredEvents.get(eventName), ownerClassName)) {
        throw new DuplicatedEventException(
            String.format(Locale.US, "Event %s has already been registered in %s", eventName, sRegisteredEvents.get(eventName)));
      }
    } else {
      sRegisteredEvents.put(eventName, ownerClassName);
    }
    initEventSubject(eventName);
  }

// Path: mvvm-life-cycle/src/main/java/me/henrytao/mvvmlifecycle/event/Event.java
// public interface Event extends Action1<Object> {
// 
// }


// Path: mvvm-life-cycle/src/main/java/me/henrytao/mvvmlifecycle/viewmodel/ViewModelWithEventDispatcher.java
import android.text.TextUtils;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import me.henrytao.mvvmlifecycle.event.Event;
import rx.Subscription;
import rx.functions.Action1;
import rx.subjects.PublishSubject;

    }
  }

  public void dispatch(Enum eventName, Object... objects) {
    dispatch(eventName.toString(), objects);
  }

  public void dispatch(String eventName, Object... objects) {
    if (sEventSubject.containsKey(eventName)) {
      sEventSubject.get(eventName).onNext(objects);
    }
  }

  public void register(Object owner, Enum event) {
    register(owner, event.toString());
  }

  public void register(Object owner, String eventName) {
    String ownerClassName = owner.getClass().toString();
    if (sRegisteredEvents.containsKey(eventName)) {
      if (!TextUtils.equals(sRegisteredEvents.get(eventName), ownerClassName)) {
        throw new DuplicatedEventException(
            String.format(Locale.US, "Event %s has already been registered in %s", eventName, sRegisteredEvents.get(eventName)));
      }
    } else {
      sRegisteredEvents.put(eventName, ownerClassName);
    }
    initEventSubject(eventName);
  }

  public Subscription subscribe(Enum eventName, Event event, Action1<Throwable> onError) {