Class UniqueItemsPlugin
java.lang.Object
software.amazon.smithy.model.validation.node.MemberAndShapeTraitPlugin<ArrayNode,UniqueItemsTrait>
software.amazon.smithy.model.validation.node.UniqueItemsPlugin
- All Implemented Interfaces:
NodeValidatorPlugin
Validates that items in lists with the `@uniqueItems` trait are unique.
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
NodeValidatorPlugin.Context, NodeValidatorPlugin.Emitter -
Field Summary
Fields inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
EMPTY_STRING_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheck(Shape shape, UniqueItemsTrait trait, ArrayNode value, NodeValidatorPlugin.Context context, NodeValidatorPlugin.Emitter emitter) Validates the given node value.A filter expressing the shape types this plugin applies to.Methods inherited from class software.amazon.smithy.model.validation.node.MemberAndShapeTraitPlugin
applyMatchingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
apply
-
Constructor Details
-
UniqueItemsPlugin
public UniqueItemsPlugin()
-
-
Method Details
-
shapeTypeFilter
Description copied from interface:NodeValidatorPluginA filter expressing the shape types this plugin applies to.- Returns:
- A
ShapeTypeFilterthat matches aShapeTypeif this plugin has an effect on shapes of that type.
-
check
protected void check(Shape shape, UniqueItemsTrait trait, ArrayNode value, NodeValidatorPlugin.Context context, NodeValidatorPlugin.Emitter emitter) Description copied from class:MemberAndShapeTraitPluginValidates the given node value.Implementors can assume the given trait is applied to the given shape.
- Specified by:
checkin classMemberAndShapeTraitPlugin<ArrayNode,UniqueItemsTrait> - Parameters:
shape- The shape the given value is for.trait- The applied trait on the given shape.value- TheNodevalue to validate.context- The plugin validation context.emitter- The emitter to emit any validation events that occur.
-