Class EnumShape
java.lang.Object
software.amazon.smithy.model.shapes.Shape
software.amazon.smithy.model.shapes.SimpleShape
software.amazon.smithy.model.shapes.StringShape
software.amazon.smithy.model.shapes.EnumShape
- All Implemented Interfaces:
- Comparable<Shape>,- FromSourceLocation,- ToShapeId,- Tagged,- ToSmithyBuilder<StringShape>
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescription<R> Raccept(ShapeVisitor<R> cases) Dispatches the shape to the appropriateShapeVisitormethod.static EnumShape.Builderbuilder()static booleancanConvertToEnum(StringShape shape, boolean synthesizeEnumNames) Determines whether a given string shape can be converted to an enum shape.Attempts to find a trait applied to the shape by name.fromStringShape(StringShape shape) Converts a baseStringShapeto anEnumShapeif possible.fromStringShape(StringShape shape, boolean synthesizeNames) Converts a baseStringShapeto anEnumShapeif possible.Gets the members of the shape, including mixin members.Gets a map of enum member names to their corresponding values.getType()Gets the type of the shape.Take this object and create a builder that contains all of the current property values of this object.Methods inherited from class software.amazon.smithy.model.shapes.StringShapeasStringShapeMethods inherited from class software.amazon.smithy.model.shapes.ShapeasBigDecimalShape, asBigIntegerShape, asBlobShape, asBooleanShape, asByteShape, asDocumentShape, asDoubleShape, asFloatShape, asIntegerShape, asIntEnumShape, asListShape, asLongShape, asMapShape, asMemberShape, asOperationShape, asResourceShape, asServiceShape, asSetShape, asShortShape, asStructureShape, asTimestampShape, asUnionShape, compareTo, equals, expectTrait, findMemberTrait, findTrait, getAllTraits, getId, getIntroducedTraits, getMember, getMemberNames, getMemberTrait, getMixins, getRequiredMixinMember, getSourceLocation, getTags, getTrait, hashCode, hasTrait, hasTrait, hasTrait, isBigDecimalShape, isBigIntegerShape, isBlobShape, isBooleanShape, isByteShape, isDocumentShape, isDoubleShape, isEnumShape, isFloatShape, isIntegerShape, isIntEnumShape, isListShape, isLongShape, isMapShape, isMemberShape, isOperationShape, isResourceShape, isServiceShape, isSetShape, isShortShape, isStringShape, isStructureShape, isTimestampShape, isUnionShape, members, shapeToBuilder, toShapeId, toString, validateMemberShapeIds, validateMixins
- 
Method Details- 
getEnumValuesGets a map of enum member names to their corresponding values.- Returns:
- A map of member names to enum values.
 
- 
getAllMembersGets the members of the shape, including mixin members.- Overrides:
- getAllMembersin class- Shape
- Returns:
- Returns the immutable member map.
 
- 
findTraitDescription copied from class:ShapeAttempts to find a trait applied to the shape by name.
- 
builder
- 
toBuilderDescription copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
- toBuilderin interface- ToSmithyBuilder<StringShape>
- Overrides:
- toBuilderin class- StringShape
- Returns:
- a builder for type T
 
- 
acceptDescription copied from class:ShapeDispatches the shape to the appropriateShapeVisitormethod.- Overrides:
- acceptin class- StringShape
- Type Parameters:
- R- Return type of the accept.
- Parameters:
- cases- ShapeVisitor to use.
- Returns:
- Returns the result.
 
- 
asEnumShape- Overrides:
- asEnumShapein class- Shape
- Returns:
- Optionally returns the shape as a EnumShape.
 
- 
fromStringShapeConverts a baseStringShapeto anEnumShapeif possible. The result will be empty if the given shape doesn't have theEnumTrait, if the enum doesn't have names and name synthesization is disabled, or if a name cannot be synthesized.- Parameters:
- shape- A base- StringShapeto convert.
- synthesizeNames- Whether names should be synthesized if possible.
- Returns:
- Optionally returns an EnumShapeequivalent of the given shape.
 
- 
fromStringShapeConverts a baseStringShapeto anEnumShapeif possible. The result will be empty if the given shape doesn't have theEnumTraitor if the enum definitions don't have names.- Parameters:
- shape- A base- StringShapeto convert.
- Returns:
- Optionally returns an EnumShapeequivalent of the given shape.
 
- 
canConvertToEnumDetermines whether a given string shape can be converted to an enum shape.- Parameters:
- shape- The string shape to be converted.
- synthesizeEnumNames- Whether synthesizing enum names should be accounted for.
- Returns:
- Returns true if the string shape can be converted to an enum shape.
 
- 
getTypeDescription copied from class:ShapeGets the type of the shape.- Overrides:
- getTypein class- StringShape
- Returns:
- Returns the type;
 
 
-