Package com.tngtech.archunit.lang
Class ConditionEvents
- java.lang.Object
-
- com.tngtech.archunit.lang.ConditionEvents
-
- All Implemented Interfaces:
java.lang.Iterable<ConditionEvent>
public final class ConditionEvents extends java.lang.Object implements java.lang.Iterable<ConditionEvent>
-
-
Constructor Summary
Constructors Constructor Description ConditionEvents()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(ConditionEvent event)
boolean
containViolation()
void
describeFailuresTo(CollectsLines messages)
Deprecated.Use the result ofgetFailureDescriptionLines()
instead.java.util.Collection<ConditionEvent>
getAllowed()
java.util.List<java.lang.String>
getFailureDescriptionLines()
java.util.Collection<ConditionEvent>
getViolating()
void
handleViolations(ViolationHandler<?> violationHandler)
Passes violations to the suppliedViolationHandler
.boolean
isEmpty()
java.util.Iterator<ConditionEvent>
iterator()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ConditionEvents
@PublicAPI(usage=ACCESS) public ConditionEvents()
-
-
Method Detail
-
add
@PublicAPI(usage=ACCESS) public void add(ConditionEvent event)
-
getViolating
@PublicAPI(usage=ACCESS) public java.util.Collection<ConditionEvent> getViolating()
-
getAllowed
@PublicAPI(usage=ACCESS) public java.util.Collection<ConditionEvent> getAllowed()
-
containViolation
@PublicAPI(usage=ACCESS) public boolean containViolation()
-
isEmpty
@PublicAPI(usage=ACCESS) public boolean isEmpty()
-
describeFailuresTo
@Deprecated @PublicAPI(usage=ACCESS) public void describeFailuresTo(CollectsLines messages)
Deprecated.Use the result ofgetFailureDescriptionLines()
instead.describeFailuresTo(lineCollector)
has the same behavior as simply adding allgetFailureDescriptionLines()
to thelineCollector
.
-
getFailureDescriptionLines
@PublicAPI(usage=ACCESS) public java.util.List<java.lang.String> getFailureDescriptionLines()
- Returns:
- List of text lines describing the contained failures of these events.
-
handleViolations
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public void handleViolations(ViolationHandler<?> violationHandler)
Passes violations to the suppliedViolationHandler
. The passed violations will automatically be filtered by the reified type of the givenViolationHandler
. That is, if aViolationHandler<SomeClass>
is passed, only violations by objects assignable toSomeClass
will be reported. The term 'reified' means that the type parameter was not erased, i.e. ArchUnit can still determine the actual type parameter of the passed violation handler, otherwise the upper bound, in extreme casesObject
, will be used (i.e. all violations will be passed).- Parameters:
violationHandler
- The violation handler that is supposed to handle all violations matching the respective type parameter
-
iterator
@PublicAPI(usage=ACCESS) public java.util.Iterator<ConditionEvent> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<ConditionEvent>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-