Class NodeValidationVisitor.Builder

java.lang.Object
software.amazon.smithy.model.validation.NodeValidationVisitor.Builder
All Implemented Interfaces:
SmithyBuilder<NodeValidationVisitor>
Enclosing class:
NodeValidationVisitor

public static final class NodeValidationVisitor.Builder extends Object implements SmithyBuilder<NodeValidationVisitor>
  • Method Details

    • model

      public NodeValidationVisitor.Builder model(Model model)
      Sets the required model to use when traversing walking shapes during validation.
      Parameters:
      model - Model that contains shapes to validate.
      Returns:
      Returns the builder.
    • value

      public NodeValidationVisitor.Builder value(Node value)
      Sets the required node value to validate.
      Parameters:
      value - Value to validate.
      Returns:
      Returns the builder.
    • eventId

      Sets an optional custom event ID to use for created validation events.
      Parameters:
      id - Custom event ID.
      Returns:
      Returns the builder.
    • startingContext

      public NodeValidationVisitor.Builder startingContext(String contextText)
      Sets an optional starting context of the validator that is prepended to each emitted validation event message.
      Parameters:
      contextText - Starting event message content.
      Returns:
      Returns the builder.
    • eventShapeId

      public NodeValidationVisitor.Builder eventShapeId(ShapeId eventShapeId)
      Sets an optional shape ID that is used as the shape ID in each validation event emitted by the validator.
      Parameters:
      eventShapeId - Shape ID to set on every validation event.
      Returns:
      Returns the builder.
    • timestampValidationStrategy

      public NodeValidationVisitor.Builder timestampValidationStrategy(TimestampValidationStrategy timestampValidationStrategy)
      Sets the strategy used to validate timestamps.

      By default, timestamps are validated using TimestampValidationStrategy.FORMAT.

      Parameters:
      timestampValidationStrategy - Timestamp validation strategy.
      Returns:
      Returns the builder.
    • allowBoxedNull

      @Deprecated public NodeValidationVisitor.Builder allowBoxedNull(boolean allowBoxedNull)
      Deprecated.
    • allowOptionalNull

      public NodeValidationVisitor.Builder allowOptionalNull(boolean allowOptionalNull)
      Configure how null values are handled when they are provided for optional types.

      By default, null values are not allowed for optional types.

      Parameters:
      allowOptionalNull - Set to true to allow null values for optional shapes.
      Returns:
      Returns the builder.
    • addFeature

      Adds a feature flag to the validator.
      Parameters:
      feature - Feature to set.
      Returns:
      Returns the builder.
    • build

      public NodeValidationVisitor 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 interface SmithyBuilder<NodeValidationVisitor>
      Returns:
      an instance of T