Package com.iizix.push
Class PushNotificationEvent
java.lang.Object
com.iizix.push.PushNotificationEvent
Push 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
FieldsModifier and TypeFieldDescriptionfinal ThrowableThe exception thrown in case ofPushNotificationState.ERROR,nullotherwise.final PushNotificationStateThe notification event state.Constructor Summary
ConstructorsConstructorDescriptionCreates a notification event without exception, e.g.PushNotificationEvent(Throwable exception) Creates a notification event with exception, i.e.Method Summary
Field Details
state
The notification event state.exception
The exception thrown in case ofPushNotificationState.ERROR,nullotherwise.
Constructor Details
PushNotificationEvent
Creates a notification event without exception, e.g. for the typesPushNotificationState.SUCCESSorPushNotificationState.SERVICE_STOPPED.- Parameters:
state- The notification state: must be eitherPushNotificationState.SUCCESSorPushNotificationState.SERVICE_STOPPED- Throws:
IllegalArgumentException- For invalidstateasPushNotificationState.ERRORrequires anexception.NullPointerException- Ifstateisnull.
PushNotificationEvent
Creates a notification event with exception, i.e. for the statePushNotificationState.ERROR.- Parameters:
exception- The exception, non-null.- Throws:
IllegalArgumentException- For invalidstateifexceptionisnull.NullPointerException- IfstateisnullorPushNotificationState.ERRORandexceptionisnull.
Method Details
getState
Gets the notification event type.- Returns:
- The type.
getException
Gets the exception in case an error occurred, i.e. ifgetState()returnsPushNotificationState.ERROR.- Returns:
- The exception, or
nullfor none.
hashCode
public int hashCode()equals
toString