Enum ShapeType
- java.lang.Object
-
- java.lang.Enum<ShapeType>
-
- software.amazon.smithy.model.shapes.ShapeType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShapeType.Category
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractShapeBuilder<?,?>
createBuilderForType()
Creates a shape builder that corresponds to the shape type.static java.util.Optional<ShapeType>
fromString(java.lang.String text)
Create a new Shape.Type from a string.ShapeType.Category
getCategory()
Returns the category of the shape type, as defined in the Smithy specification (one of SIMPLE, AGGREGATE, or SERVICE).java.lang.Class<? extends Shape>
getShapeClass()
Gets the class that implements this shape type.boolean
isShapeType(ShapeType other)
Returns whether this shape type is equivalent to the given shape type, accounting for things like enums being considered specializations of strings.java.lang.String
toString()
static ShapeType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ShapeType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLOB
public static final ShapeType BLOB
-
BOOLEAN
public static final ShapeType BOOLEAN
-
STRING
public static final ShapeType STRING
-
TIMESTAMP
public static final ShapeType TIMESTAMP
-
BYTE
public static final ShapeType BYTE
-
SHORT
public static final ShapeType SHORT
-
INTEGER
public static final ShapeType INTEGER
-
LONG
public static final ShapeType LONG
-
FLOAT
public static final ShapeType FLOAT
-
DOCUMENT
public static final ShapeType DOCUMENT
-
DOUBLE
public static final ShapeType DOUBLE
-
BIG_DECIMAL
public static final ShapeType BIG_DECIMAL
-
BIG_INTEGER
public static final ShapeType BIG_INTEGER
-
ENUM
public static final ShapeType ENUM
-
INT_ENUM
public static final ShapeType INT_ENUM
-
LIST
public static final ShapeType LIST
-
SET
public static final ShapeType SET
-
MAP
public static final ShapeType MAP
-
STRUCTURE
public static final ShapeType STRUCTURE
-
UNION
public static final ShapeType UNION
-
MEMBER
public static final ShapeType MEMBER
-
SERVICE
public static final ShapeType SERVICE
-
RESOURCE
public static final ShapeType RESOURCE
-
OPERATION
public static final ShapeType OPERATION
-
-
Method Detail
-
values
public static ShapeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ShapeType c : ShapeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ShapeType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<ShapeType>
-
getShapeClass
public java.lang.Class<? extends Shape> getShapeClass()
Gets the class that implements this shape type.- Returns:
- Returns the shape class.
-
getCategory
public ShapeType.Category getCategory()
Returns the category of the shape type, as defined in the Smithy specification (one of SIMPLE, AGGREGATE, or SERVICE).- Returns:
- Returns the category of the type.
-
isShapeType
public boolean isShapeType(ShapeType other)
Returns whether this shape type is equivalent to the given shape type, accounting for things like enums being considered specializations of strings.- Parameters:
other
- The other shape type to compare against.- Returns:
- Returns true if the shape types are equivalent.
-
fromString
public static java.util.Optional<ShapeType> fromString(java.lang.String text)
Create a new Shape.Type from a string.- Parameters:
text
- Text to convert into a Shape.Type- Returns:
- Returns the Type in an Optional.
-
createBuilderForType
public AbstractShapeBuilder<?,?> createBuilderForType()
Creates a shape builder that corresponds to the shape type.- Returns:
- Returns a shape builder corresponding to the type.
-
-