public final class ValidationEvent extends java.lang.Object implements java.lang.Comparable<ValidationEvent>, ToNode, ToSmithyBuilder<ValidationEvent>
Validation events are collection while assembling and validating a model. Events with a severity less than ERROR can be suppressed. All events contain a message, severity, and eventId.
Modifier and Type | Class and Description |
---|---|
static class |
ValidationEvent.Builder
Builds ValidationEvent values.
|
Modifier and Type | Method and Description |
---|---|
static ValidationEvent.Builder |
builder() |
int |
compareTo(ValidationEvent other) |
boolean |
equals(java.lang.Object o) |
static ValidationEvent |
fromNode(Node node) |
static ValidationEvent |
fromSourceException(SourceException exception)
Creates a new ValidationEvent from a
SourceException . |
static ValidationEvent |
fromSourceException(SourceException exception,
java.lang.String prefix)
Creates a new ValidationEvent from a
SourceException . |
java.lang.String |
getEventId()
Deprecated.
Use the
getId() method to match the node format. |
java.lang.String |
getId()
Returns the identifier of the validation event.
|
java.lang.String |
getMessage() |
Severity |
getSeverity() |
java.util.Optional<ShapeId> |
getShapeId() |
SourceLocation |
getSourceLocation() |
java.util.Optional<java.lang.String> |
getSuppressionReason()
Get the reason that the event was suppressed.
|
int |
hashCode() |
ValidationEvent.Builder |
toBuilder()
Take this object and create a builder that contains all of the
current property values of this object.
|
Node |
toNode()
Converts a value to a
Node . |
java.lang.String |
toString() |
public static ValidationEvent.Builder builder()
public static ValidationEvent fromSourceException(SourceException exception)
SourceException
.exception
- Exception to use to create the event.public static ValidationEvent fromSourceException(SourceException exception, java.lang.String prefix)
SourceException
.exception
- Exception to use to create the event.prefix
- Prefix string to add to the message.public int compareTo(ValidationEvent other)
compareTo
in interface java.lang.Comparable<ValidationEvent>
public ValidationEvent.Builder toBuilder()
ToSmithyBuilder
toBuilder
in interface ToSmithyBuilder<ValidationEvent>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static ValidationEvent fromNode(Node node)
public SourceLocation getSourceLocation()
public java.lang.String getMessage()
public Severity getSeverity()
public java.lang.String getEventId()
getId()
method to match the node format.The validation event identifier can be used to suppress events.
public java.lang.String getId()
The validation event identifier can be used to suppress events.
public java.util.Optional<ShapeId> getShapeId()
public java.util.Optional<java.lang.String> getSuppressionReason()