Package com.pnfsoftware.jeb.core.events
Class AbstractQuestionNotification<T>
java.lang.Object
com.pnfsoftware.jeb.core.events.ClientNotification
com.pnfsoftware.jeb.core.events.AbstractQuestionNotification<T>
- Type Parameters:
T- response type
- Direct Known Subclasses:
QuestionNotificationPath,QuestionNotificationText,QuestionNotificationYesNo
Blocking client notification that requires a client-provided response.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractQuestionNotification(String question, T defaultResponse, boolean askDoNotShowAnymore) Create a blocking question notification. -
Method Summary
Modifier and TypeMethodDescriptionGet the default response value.Get the effective response value.booleanDetermine whether clients should offer a "do not show again" option.booleanDetermine whether the user asked not to show this notification again.voidsetDoNotShowAnymoreResponse(boolean doNotShowAnymoreResponse) Set the recorded "do not show again" response.voidsetResponse(T response) Set the explicit response value.Methods inherited from class com.pnfsoftware.jeb.core.events.ClientNotification
getLevel, getMessage
-
Constructor Details
-
AbstractQuestionNotification
public AbstractQuestionNotification(String question, T defaultResponse, boolean askDoNotShowAnymore) Create a blocking question notification.- Parameters:
question- question text shown to the userdefaultResponse- default response valueaskDoNotShowAnymore-trueif clients should offer a "do not show again" option
-
-
Method Details
-
getDefaultResponse
Get the default response value.- Returns:
- the default response
-
setResponse
Set the explicit response value.- Parameters:
response- response chosen by the client
-
getResponse
Get the effective response value.- Returns:
- the explicit response if one was set, otherwise the default response
-
isAskDoNotShowAnymore
public boolean isAskDoNotShowAnymore()Determine whether clients should offer a "do not show again" option.- Returns:
trueif that option should be presented
-
isDoNotShowAnymoreResponse
public boolean isDoNotShowAnymoreResponse()Determine whether the user asked not to show this notification again.- Returns:
trueif the client recorded that response
-
setDoNotShowAnymoreResponse
public void setDoNotShowAnymoreResponse(boolean doNotShowAnymoreResponse) Set the recorded "do not show again" response.- Parameters:
doNotShowAnymoreResponse- response value supplied by the client
-