Class Matcher
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.assertions.Matcher
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
Capture
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-06T23:25:03.195Z")
@Stability(Stable)
public abstract class Matcher
extends software.amazon.jsii.JsiiObject
Represents a matcher that can perform special data matching capabilities between a given pattern and a target.
Example:
// Given a template - // { // "Resources": { // "MyBar": { // "Type": "Foo::Bar", // "Properties": { // "Fred": { // "Wobble": ["Flob", "Flib"], // } // } // } // } // } // The following will NOT throw an assertion error template.hasResourceProperties("Foo::Bar", Map.of( "Fred", Map.of( "Wobble", List.of(Match.anyValue(), Match.anyValue())))); // The following will throw an assertion error template.hasResourceProperties("Foo::Bar", Map.of( "Fred", Map.of( "Wimble", Match.anyValue())));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
-
Method Summary
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Matcher
protected Matcher(software.amazon.jsii.JsiiObjectRef objRef) -
Matcher
protected Matcher(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Matcher
@Stability(Stable) protected Matcher()
-
-
Method Details
-
isMatcher
Check whether the provided object is a subtype of theIMatcher
.- Parameters:
x
- This parameter is required.
-
test
Test whether a target matches the provided pattern.Every Matcher must implement this method. This method will be invoked by the assertions framework. Do not call this method directly.
- Parameters:
actual
- the target to match. This parameter is required.- Returns:
- the list of match failures. An empty array denotes a successful match.
-
getName
A name for the matcher.This is collected as part of the result and may be presented to the user.
-