Class ValidationEvent.Builder
- java.lang.Object
-
- software.amazon.smithy.model.validation.ValidationEvent.Builder
-
- All Implemented Interfaces:
SmithyBuilder<ValidationEvent>
- Enclosing class:
- ValidationEvent
public static final class ValidationEvent.Builder extends java.lang.Object implements SmithyBuilder<ValidationEvent>
Builds ValidationEvent values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ValidationEvent
build()
Creates an immutable object that is created from the properties that have been set on the builder.ValidationEvent.Builder
eventId(java.lang.String eventId)
Deprecated.Use theid(String eventId)
setter to match the node format.ValidationEvent.Builder
hint(java.lang.String hint)
Sets an optional hint adding more detail about how to fix a specific issue.ValidationEvent.Builder
id(java.lang.String eventId)
Sets the required event ID of the event.ValidationEvent.Builder
message(java.lang.String eventMessage)
Sets the required message of the event.ValidationEvent.Builder
message(java.lang.String eventMessage, java.lang.Object... placeholders)
ValidationEvent.Builder
severity(Severity severity)
Sets the required severity of the event.ValidationEvent.Builder
shape(Shape encounteredShape)
Sets the shape ID and source location based on a shape.<T extends ToShapeId>
ValidationEvent.BuildershapeId(T toShapeId)
Sets the shape ID related to the event.ValidationEvent.Builder
sourceLocation(FromSourceLocation sourceLocation)
Sets the source location of where the event occurred.ValidationEvent.Builder
suppressionReason(java.lang.String eventSuppressionReason)
Sets a reason for suppressing the event.
-
-
-
Method Detail
-
message
public ValidationEvent.Builder message(java.lang.String eventMessage)
Sets the required message of the event.- Parameters:
eventMessage
- Message to set.- Returns:
- Returns the builder.
-
message
public ValidationEvent.Builder message(java.lang.String eventMessage, java.lang.Object... placeholders)
-
severity
public ValidationEvent.Builder severity(Severity severity)
Sets the required severity of the event.- Parameters:
severity
- Event severity.- Returns:
- Returns the builder.
-
eventId
public ValidationEvent.Builder eventId(java.lang.String eventId)
Deprecated.Use theid(String eventId)
setter to match the node format.Sets the required event ID of the event.- Parameters:
eventId
- Event ID.- Returns:
- Returns the builder.
-
id
public ValidationEvent.Builder id(java.lang.String eventId)
Sets the required event ID of the event.- Parameters:
eventId
- Event ID.- Returns:
- Returns the builder.
-
sourceLocation
public ValidationEvent.Builder sourceLocation(FromSourceLocation sourceLocation)
Sets the source location of where the event occurred.- Parameters:
sourceLocation
- Event source location.- Returns:
- Returns the builder.
-
shapeId
public <T extends ToShapeId> ValidationEvent.Builder shapeId(T toShapeId)
Sets the shape ID related to the event.- Type Parameters:
T
- Value to convert to a shape ID.- Parameters:
toShapeId
- Shape ID.- Returns:
- Returns the builder.
-
shape
public ValidationEvent.Builder shape(Shape encounteredShape)
Sets the shape ID and source location based on a shape.- Parameters:
encounteredShape
- Shape.- Returns:
- Returns the builder.
-
suppressionReason
public ValidationEvent.Builder suppressionReason(java.lang.String eventSuppressionReason)
Sets a reason for suppressing the event.This is only relevant if the severity is SUPPRESSED.
- Parameters:
eventSuppressionReason
- Event suppression reason.- Returns:
- Returns the builder.
-
hint
public ValidationEvent.Builder hint(java.lang.String hint)
Sets an optional hint adding more detail about how to fix a specific issue.- Parameters:
hint
- Hint to set- Returns:
- Returns the builder.
-
build
public ValidationEvent build()
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<ValidationEvent>
- Returns:
- an instance of T
-
-