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
public final class ErrorTrait extends StringTrait
Indicates that a structure can be used as an error.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ErrorTrait.Provider
-
Constructor Summary
Constructors Constructor Description ErrorTrait(java.lang.String value)
ErrorTrait(java.lang.String value, SourceLocation sourceLocation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDefaultHttpStatusCode()
Returns the recommended default HTTP status code of the error.boolean
isClientError()
boolean
isServerError()
-
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 Detail
-
ID
public static final ShapeId ID
-
-
Constructor Detail
-
ErrorTrait
public ErrorTrait(java.lang.String value, SourceLocation sourceLocation)
-
ErrorTrait
public ErrorTrait(java.lang.String value)
-
-
Method Detail
-
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.
-
-