Package com.tngtech.archunit.lang
Class SimpleConditionEvent
- java.lang.Object
-
- com.tngtech.archunit.lang.SimpleConditionEvent
-
- All Implemented Interfaces:
ConditionEvent
@PublicAPI(usage=ACCESS) public final class SimpleConditionEvent extends java.lang.Object implements ConditionEvent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tngtech.archunit.lang.ConditionEvent
ConditionEvent.Handler
-
-
Constructor Summary
Constructors Constructor Description SimpleConditionEvent(java.lang.Object correspondingObject, boolean conditionSatisfied, java.lang.String message)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddInvertedTo(ConditionEvents events)Adds the 'opposite' of the event.voiddescribeTo(CollectsLines messages)Deprecated.java.util.List<java.lang.String>getDescriptionLines()voidhandleWith(ConditionEvent.Handler handler)Supplies the corresponding objects and description to the supplied handler.booleanisViolation()static ConditionEventsatisfied(java.lang.Object correspondingObject, java.lang.String message)java.lang.StringtoString()static ConditionEventviolated(java.lang.Object correspondingObject, java.lang.String message)
-
-
-
Method Detail
-
isViolation
public boolean isViolation()
- Specified by:
isViolationin interfaceConditionEvent- Returns:
- true, IFF this event represents a violation of an evaluated rule.
-
addInvertedTo
public void addInvertedTo(ConditionEvents events)
Description copied from interface:ConditionEventAdds the 'opposite' of the event.
E.g. The event is a violation, if some conditions A and B are both true?
-> The 'inverted' event is a violation if either A or B (or both) are not true
In the most simple case, this is just an equivalent event evaluatingConditionEvent.isViolation()inverted.- Specified by:
addInvertedToin interfaceConditionEvent- Parameters:
events- The events to add the 'inverted self' to
-
describeTo
@Deprecated public void describeTo(CollectsLines messages)
Deprecated.Description copied from interface:ConditionEventAdds a textual description of this event to the suppliedCollectsLines.- Specified by:
describeToin interfaceConditionEvent- Parameters:
messages- The message lines to append the description to.
-
getDescriptionLines
public java.util.List<java.lang.String> getDescriptionLines()
- Specified by:
getDescriptionLinesin interfaceConditionEvent- Returns:
- A textual description of this event as a list of lines
-
handleWith
public void handleWith(ConditionEvent.Handler handler)
Description copied from interface:ConditionEventSupplies the corresponding objects and description to the supplied handler.
The term "corresponding objects" refers to the objects involved in the evaluation of this rule. E.g. the rule checks for illegal field accesses, then this object might be a single field access checked by the rule.
May also be a collection of objects, if the evaluation of the rule depends on sets of objects. E.g. the rule checks that some access to another class happened? The rule can only be violated, by a whole set (all accesses from a class) of objects, but not by a single one (if there is more than one).- Specified by:
handleWithin interfaceConditionEvent- Parameters:
handler- The handler to supply the data of this event to.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
violated
public static ConditionEvent violated(java.lang.Object correspondingObject, java.lang.String message)
-
satisfied
public static ConditionEvent satisfied(java.lang.Object correspondingObject, java.lang.String message)
-
-