@FunctionalInterface
public interface Suppression
ValidationEvent
s emitted from Validator
s.Modifier and Type | Method and Description |
---|---|
static Suppression |
fromMetadata(Node node)
Creates a suppression from a
Node found in the
"suppressions" metadata of a Smithy model. |
static Suppression |
fromSuppressTrait(Shape shape)
Creates a suppression using the
SuppressTrait of
the given shape. |
default java.util.Optional<java.lang.String> |
getReason()
Gets the optional reason for the suppression.
|
boolean |
test(ValidationEvent event)
Determines if the suppression applies to the given event.
|
boolean test(ValidationEvent event)
event
- Event to test.default java.util.Optional<java.lang.String> getReason()
static Suppression fromSuppressTrait(Shape shape)
SuppressTrait
of
the given shape.shape
- Shape to get the SuppressTrait
from.ExpectationNotMetException
- if the shape has no SuppressTrait
.static Suppression fromMetadata(Node node)
Node
found in the
"suppressions" metadata of a Smithy model.node
- Node to parse.ExpectationNotMetException
- if the suppression node is malformed.