Package software.amazon.smithy.contracts
Class ConditionsTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.contracts.ConditionsTrait
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToShapeId,Trait,ToSmithyBuilder<ConditionsTrait>
public final class ConditionsTrait
extends AbstractTrait
implements ToSmithyBuilder<ConditionsTrait>
Restricts shape values to those that satisfy one or more JMESPath expressions.
Each expression must produce 'true'.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forConditionsTrait.static final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ConditionsTrait.Builderbuilder()Creates a builder used to build aConditionsTrait.protected NodeThe result of toNode is used for hashCodes and equality.static ConditionsTraitCreates aConditionsTraitfrom aNode.Gets the map of condition names toConditions.Converts this trait to a builder used to build an equivalentConditionsTrait.Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
Field Details
-
ID
-
-
Method Details
-
createNode
Description copied from class:AbstractTraitThe result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNodein classAbstractTrait- Returns:
- Returns the trait as a node.
-
fromNode
Creates aConditionsTraitfrom aNode.- Parameters:
node- Node to create the ConditionsTrait from.- Returns:
- Returns the created ConditionsTrait.
- Throws:
ExpectationNotMetException- if the given Node is invalid.
-
getConditions
Gets the map of condition names toConditions.- Returns:
- Returns the conditions map.
-
toBuilder
Converts this trait to a builder used to build an equivalentConditionsTrait.- Specified by:
toBuilderin interfaceToSmithyBuilder<ConditionsTrait>- Returns:
- a builder for type T
-
builder
Creates a builder used to build aConditionsTrait.
-