Package com.iizix.push
Class PushNotificationEvent
- java.lang.Object
- com.iizix.push.PushNotificationEvent
 
- public class PushNotificationEvent extends java.lang.ObjectPush notification event generated when a push notification state changes, e.g. a notification has been sent successfully, or when the operation failed, the client unknown or the push service is stopped.- Author:
- Christopher Mindus
 
- Field Summary- Fields - Modifier and Type - Field - Description - java.lang.Throwable- exceptionThe exception thrown in case of- PushNotificationState.ERROR,- nullotherwise.- PushNotificationState- stateThe notification event state.
 - Constructor Summary- Constructors - Constructor - Description - PushNotificationEvent(PushNotificationState state)Creates a notification event without exception, e.g.- PushNotificationEvent(java.lang.Throwable exception)Creates a notification event with exception, i.e.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - boolean- equals(java.lang.Object obj)- java.lang.Throwable- getException()Gets the exception in case an error occurred, i.e.- PushNotificationState- getState()Gets the notification event type.- int- hashCode()- java.lang.String- toString()
 
- Field Detail- state- public final PushNotificationState state The notification event state.
 - exception- public final java.lang.Throwable exception The exception thrown in case of- PushNotificationState.ERROR,- nullotherwise.
 
 - Constructor Detail- PushNotificationEvent- public PushNotificationEvent(PushNotificationState state) Creates a notification event without exception, e.g. for the types- PushNotificationState.SUCCESSor- PushNotificationState.SERVICE_STOPPED.- Parameters:
- state- The notification state: must be either- PushNotificationState.SUCCESSor- PushNotificationState.SERVICE_STOPPED
- Throws:
- java.lang.IllegalArgumentException- For invalid- stateas- PushNotificationState.ERRORrequires an- exception.
- java.lang.NullPointerException- If- stateis- null.
 
 - PushNotificationEvent- public PushNotificationEvent(java.lang.Throwable exception) Creates a notification event with exception, i.e. for the state- PushNotificationState.ERROR.- Parameters:
- exception- The exception, non-null.
- Throws:
- java.lang.IllegalArgumentException- For invalid- stateif- exceptionis- null.
- java.lang.NullPointerException- If- stateis- nullor- PushNotificationState.ERRORand- exceptionis- null.
 
 
 - Method Detail- getState- public PushNotificationState getState() Gets the notification event type.- Returns:
- The type.
 
 - getException- public java.lang.Throwable getException() Gets the exception in case an error occurred, i.e. if- getState()returns- PushNotificationState.ERROR.- Returns:
- The exception, or nullfor none.
 
 - hashCode- public int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - equals- public boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - toString- public java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object