Class ErrorTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.StringTrait
software.amazon.smithy.model.traits.ErrorTrait
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
Indicates that a structure can be used as an error.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionErrorTrait
(String value) ErrorTrait
(String value, SourceLocation sourceLocation) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the recommended default HTTP status code of the error.boolean
boolean
Methods inherited from class software.amazon.smithy.model.traits.StringTrait
createNode, getValue
Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
Field Details
-
ID
-
-
Constructor Details
-
ErrorTrait
-
ErrorTrait
-
-
Method Details
-
getDefaultHttpStatusCode
public int getDefaultHttpStatusCode()Returns the recommended default HTTP status code of the error.- Returns:
- Returns the default HTTP status code.
-
isClientError
public boolean isClientError()- Returns:
- Returns true if is a client error.
-
isServerError
public boolean isServerError()- Returns:
- Returns true if it is a server error.
-