Class ValidationEvent
java.lang.Object
software.amazon.smithy.model.validation.ValidationEvent
- All Implemented Interfaces:
Comparable<ValidationEvent>,ToNode,ToSmithyBuilder<ValidationEvent>
public final class ValidationEvent
extends Object
implements Comparable<ValidationEvent>, ToNode, ToSmithyBuilder<ValidationEvent>
A validation event created when validating a model.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds ValidationEvent values. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationEvent.Builderbuilder()intcompareTo(ValidationEvent other) booleanstatic ValidationEventstatic ValidationEventfromSourceException(SourceException exception) Creates a new ValidationEvent from aSourceException.static ValidationEventfromSourceException(SourceException exception, String prefix) Creates a new ValidationEvent from aSourceException.Deprecated.getId()Returns the identifier of the validation event.Get the reason that the event was suppressed.inthashCode()Take this object and create a builder that contains all of the current property values of this object.toNode()Converts a value to aNode.toString()
-
Method Details
-
builder
-
fromSourceException
Creates a new ValidationEvent from aSourceException.- Parameters:
exception- Exception to use to create the event.- Returns:
- Returns a created validation event with an ID of Model.
-
fromSourceException
Creates a new ValidationEvent from aSourceException.- Parameters:
exception- Exception to use to create the event.prefix- Prefix string to add to the message.- Returns:
- Returns a created validation event with an ID of Model.
-
compareTo
- Specified by:
compareToin interfaceComparable<ValidationEvent>
-
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<ValidationEvent>- Returns:
- a builder for type T
-
equals
-
hashCode
public int hashCode() -
toString
-
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
fromNode
-
getSourceLocation
- Returns:
- The location at which the event occurred.
-
getMessage
- Returns:
- The human-readable event message.
-
getSeverity
- Returns:
- The severity level of the event.
-
getEventId
Deprecated.Use thegetId()method to match the node format.Returns the identifier of the validation event.The validation event identifier can be used to suppress events.
- Returns:
- Returns the event ID.
-
getId
Returns the identifier of the validation event.The validation event identifier can be used to suppress events.
- Returns:
- Returns the event ID.
-
getShapeId
- Returns:
- The shape ID that is associated with the event.
-
getSuppressionReason
Get the reason that the event was suppressed.- Returns:
- Returns the suppression reason if available.
-
getId()method to match the node format.