EventWrapperWiFiDirect.java 605 B

1234567891011121314151617181920212223242526272829
  1. package com.epson.mobilephone.common.wifidirect;
  2. public class EventWrapperWiFiDirect<T> {
  3. private boolean handled = false;
  4. private T mContent;
  5. public EventWrapperWiFiDirect(T t) {
  6. if (t != null) {
  7. mContent = t;
  8. return;
  9. }
  10. throw new IllegalArgumentException("null values in Event are not allowed.");
  11. }
  12. @Nullable
  13. public T getEventContent() {
  14. if (this.handled) {
  15. return null;
  16. }
  17. handled = true;
  18. return mContent;
  19. }
  20. public boolean hasBeenHandled() {
  21. return handled;
  22. }
  23. }