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:
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) Violations
(package private) Violations
and
(Violations other) (package private) Violations
and
(Violations.Violation violation) Creates a newViolations
with the givenRuntimeException
added to the current ones?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<Violations.Violation,
?, 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. -
and
Creates a newViolations
with the givenRuntimeException
added to the current ones?- Parameters:
violation
- must not be null.- Returns:
-
and
-
and
-