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 classMatcher.ErrorTypeMemberMatches if an operation returns an error, and the error matches the expected error type.static classMatcher.InputOutputMemberstatic classMatcher.OutputMemberstatic classMatcher.SuccessMemberWhen set to true, matches when a call returns a success response.static classMatcher.UnknownMemberRepresents an union value.static interfaceMatcher.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> Uaccept(Matcher.Visitor<U> visitor)Visits the Matcher union type.booleanequals(java.lang.Object o)static Matcher<?>fromNode(Node node)Creates aMatcherfrom aNode.abstract java.lang.StringgetMemberName()Gets the member name of the matcher.abstract TgetValue()Gets the value of the set matcher variant.inthashCode()
-
-
-
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:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
fromNode
public static Matcher<?> fromNode(Node node)
Creates aMatcherfrom aNode.- Parameters:
node-Nodeto create aMatcherfrom.- Returns:
- Returns the create
Matcher. - Throws:
ExpectationNotMetException- if the givennodeis invalid.
-
-