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
Modifier and TypeFieldDescriptionfinal Throwable
The exception thrown in case ofPushNotificationState.ERROR
,null
otherwise.final PushNotificationState
The notification event state.Constructor Summary
ConstructorDescriptionCreates 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
,null
otherwise.
Constructor Details
PushNotificationEvent
Creates a notification event without exception, e.g. for the typesPushNotificationState.SUCCESS
orPushNotificationState.SERVICE_STOPPED
.- Parameters:
state
- The notification state: must be eitherPushNotificationState.SUCCESS
orPushNotificationState.SERVICE_STOPPED
- Throws:
IllegalArgumentException
- For invalidstate
asPushNotificationState.ERROR
requires anexception
.NullPointerException
- Ifstate
isnull
.
PushNotificationEvent
Creates a notification event with exception, i.e. for the statePushNotificationState.ERROR
.- Parameters:
exception
- The exception, non-null.- Throws:
IllegalArgumentException
- For invalidstate
ifexception
isnull
.NullPointerException
- Ifstate
isnull
orPushNotificationState.ERROR
andexception
isnull
.
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
null
for none.
hashCode
public int hashCode()equals
toString