Class Violations
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.modulith.core.Violations
- All Implemented Interfaces:
Serializable
Value type to gather and report architectural violations.
- Author:
- Oliver Drotbohm
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) Violations
(package private) Violations
Creates a newViolations
with the givenRuntimeException
added to the current ones?(package private) Violations
and
(Violations that) ReturnsViolations
that match the givenPredicate
.Returns all violations' messages.boolean
Returns whether there are violations available.void
Throws itself in case it's not an empty instance.(package private) static Collector<String,
?, Violations> Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
NONE
-
-
Method Details
-
toViolations
- Returns:
- will never be null.
-
getMessage
- Overrides:
getMessage
in classThrowable
-
getMessages
Returns all violations' messages.- Returns:
- will never be null.
- Since:
- 1.1
-
hasViolations
public boolean hasViolations()Returns whether there are violations available.- Returns:
-
throwIfPresent
public void throwIfPresent()Throws itself in case it's not an empty instance. -
filter
ReturnsViolations
that match the givenPredicate
.- Parameters:
filter
- must not be null.- Returns:
-
and
Creates a newViolations
with the givenRuntimeException
added to the current ones?- Parameters:
violation
- must not be null.- Returns:
-
and
-
and
-