Package software.amazon.smithy.waiters
Class Matcher<T>
- java.lang.Object
-
- software.amazon.smithy.waiters.Matcher<T>
-
- All Implemented Interfaces:
ToNode
- Direct Known Subclasses:
Matcher.ErrorTypeMember
,Matcher.InputOutputMember
,Matcher.OutputMember
,Matcher.SuccessMember
,Matcher.UnknownMember
public abstract class Matcher<T> extends java.lang.Object implements ToNode
Determines if an acceptor matches the current state of a resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Matcher.ErrorTypeMember
Matches if an operation returns an error, and the error matches the expected error type.static class
Matcher.InputOutputMember
static class
Matcher.OutputMember
static class
Matcher.SuccessMember
When set to true, matches when a call returns a success response.static class
Matcher.UnknownMember
Represents an union value.static interface
Matcher.Visitor<T>
Visits the variants of the Matcher union type.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <U> U
accept(Matcher.Visitor<U> visitor)
Visits the Matcher union type.boolean
equals(java.lang.Object o)
static Matcher<?>
fromNode(Node node)
Creates aMatcher
from aNode
.abstract java.lang.String
getMemberName()
Gets the member name of the matcher.abstract T
getValue()
Gets the value of the set matcher variant.int
hashCode()
-
-
-
Method Detail
-
getValue
public abstract T getValue()
Gets the value of the set matcher variant.- Returns:
- Returns the set variant's value.
-
getMemberName
public abstract java.lang.String getMemberName()
Gets the member name of the matcher.- Returns:
- Returns the set member name.
-
accept
public abstract <U> U accept(Matcher.Visitor<U> visitor)
Visits the Matcher union type.- Type Parameters:
U
- The type returned by the visitor.- Parameters:
visitor
- Visitor to apply.- Returns:
- Returns the return value of the visitor.
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
fromNode
public static Matcher<?> fromNode(Node node)
Creates aMatcher
from aNode
.- Parameters:
node
-Node
to create aMatcher
from.- Returns:
- Returns the create
Matcher
. - Throws:
ExpectationNotMetException
- if the givennode
is invalid.
-
-