public abstract class ConsentAbstract extends Object implements Serializable, Consent
| Modifier | Constructor and Description |
|---|---|
protected |
ConsentAbstract(InteractionResult interactionResult) |
protected |
ConsentAbstract(String description,
String reason)
Enable legacy
Consents (not created using an
InteractionResult) to create an Consent, specifying a
description of the event and the
reason (if any) that the consent is vetoed. |
| Modifier and Type | Method and Description |
|---|---|
static Consent |
allowIf(boolean allowed)
Factory method.
|
String |
getDescription()
Description of the action allowed by this event.
|
InteractionResult |
getInteractionResult()
Underlying
InteractionResult that created this Consent
(may be null). |
String |
getReason()
The reason why this has been vetoed.
|
boolean |
isAllowed()
Returns true if this object is giving permission (if the
reason is null or empty. |
boolean |
isVetoed()
Returns true if this object is NOT giving permission.
|
Consent |
setDescription(String description)
Allows the description of the interaction to which this consent relates
to be specified or refined.
|
String |
toString() |
protected ConsentAbstract(InteractionResult interactionResult)
protected ConsentAbstract(String description, String reason)
Consents (not created using an
InteractionResult) to create an Consent, specifying a
description of the event and the
reason (if any) that the consent is vetoed.description - - a description of the event to which this consent relatesreason - - if not null and not empty, is the reason this
consent is vetoed.public static Consent allowIf(boolean allowed)
Used extensively by the DnD viewer.
public Consent setDescription(String description)
ConsentsetDescription in interface Consentpublic boolean isAllowed()
reason is null or empty.isAllowed in interface ConsentgetReason()public boolean isVetoed()
isVetoed in interface ConsentisAllowed()public InteractionResult getInteractionResult()
InteractionResult that created this Consent
(may be null).getInteractionResult in interface ConsentConsent.public String getDescription()
(Previously, Allow consents overloaded the reason property with a description of the event. This has now been
changed so that a non-null reason always implies a Veto.
This property captures the description.
getDescription in interface ConsentCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.