|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.consent.ConsentAbstract
public abstract class ConsentAbstract
| Constructor Summary | |
|---|---|
protected |
ConsentAbstract(InteractionResult interactionResult)
|
protected |
ConsentAbstract(java.lang.String description,
java.lang.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. |
| Method Summary | |
|---|---|
static Consent |
allowIf(boolean allowed)
Factory method. |
java.lang.String |
getDescription()
Description of the action allowed by this event. |
InteractionResult |
getInteractionResult()
Underlying InteractionResult that created this Consent
(may be null). |
java.lang.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(java.lang.String description)
Allows the description of the interaction to which this consent relates to be specified or refined. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ConsentAbstract(InteractionResult interactionResult)
interactionResult - - if null then defaults to an allowing Consent.
protected ConsentAbstract(java.lang.String description,
java.lang.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.| Method Detail |
|---|
public static Consent allowIf(boolean allowed)
Used extensively by the DnD viewer.
public java.lang.String getReason()
getReason in interface Consentpublic Consent setDescription(java.lang.String description)
Consent
setDescription 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 java.lang.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 Consentpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||