Class ValidationUtils

java.lang.Object
software.amazon.smithy.model.validation.ValidationUtils

public final class ValidationUtils extends Object
Utility methods used when validating.
  • Method Details

    • isCriticalValidator

      public static boolean isCriticalValidator(Class<? extends Validator> validator)
      Checks if the given validator class is a critical validator that should be applied before other downstream validators are applied.
      Parameters:
      validator - Validator class to check.
      Returns:
      Returns true if the given validator is considered a critical validator.
    • isCriticalEvent

      public static boolean isCriticalEvent(String eventId)
      Checks if the given validation event was emitted by a critical validator.
      Parameters:
      eventId - Event ID to check if it's a critical validation event.
      Returns:
      Returns true if the given event was emitted from a critical validator.
    • splitCamelCaseWord

      public static List<String> splitCamelCaseWord(String word)
      Splits a camelCase word into a list of words.
      Parameters:
      word - Word to split.
      Returns:
      Returns the split words.
    • orderedTickedList

      public static String orderedTickedList(Collection<?> values)
      Creates a comma separated string made up of the given collection. Each value is surrounded by "`", and the values are sorted to make it easier to write tests against the messages.
      Parameters:
      values - Values to turn into a comma separated list.
      Returns:
      Returns the string.
    • tickedList

      public static String tickedList(Collection<?> values)
      Creates a comma separated string made up of the given collection. Each value is surrounded by "`", and the values are sorted to make it easier to write tests against the messages.
      Parameters:
      values - Values to turn into a comma separated list.
      Returns:
      Returns the string.
    • tickedList

      public static String tickedList(Stream<?> values)
    • tickedPrettyPrintedNode

      public static String tickedPrettyPrintedNode(Node node)
      Writes the contents of a Node to a pretty-printed JSON string surrounded in backticks.
      Parameters:
      node - Node to write.
      Returns:
      Returns a string suitable for Markdown rendering.
    • findDuplicateShapeNames

      @Deprecated public static <T extends ToShapeId> Map<String,List<ShapeId>> findDuplicateShapeNames(Collection<T> shapes)
      Deprecated.