Class ValidationUtils
java.lang.Object
software.amazon.smithy.model.validation.ValidationUtils
Utility methods used when validating.
-
Method Summary
Modifier and TypeMethodDescriptionfindDuplicateShapeNames
(Collection<T> shapes) Deprecated.static boolean
isCriticalEvent
(String eventId) Checks if the given validation event was emitted by a critical validator.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.static String
orderedTickedList
(Collection<?> values) Creates a comma separated string made up of the given collection.splitCamelCaseWord
(String word) Splits a camelCase word into a list of words.static String
tickedList
(Collection<?> values) Creates a comma separated string made up of the given collection.static String
tickedList
(Stream<?> values) static String
tickedPrettyPrintedNode
(Node node) Writes the contents of a Node to a pretty-printed JSON string surrounded in backticks.
-
Method Details
-
isCriticalValidator
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
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
Splits a camelCase word into a list of words.- Parameters:
word
- Word to split.- Returns:
- Returns the split words.
-
orderedTickedList
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
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
-
tickedPrettyPrintedNode
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.
-