Class MemberShape
java.lang.Object
software.amazon.smithy.model.shapes.Shape
software.amazon.smithy.model.shapes.MemberShape
- All Implemented Interfaces:
Comparable<Shape>,FromSourceLocation,ToShapeId,Tagged,ToSmithyBuilder<MemberShape>
Represents a member that targets another shape by ID.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(ShapeVisitor<R> visitor) Dispatches the shape to the appropriateShapeVisitormethod.static MemberShape.Builderbuilder()booleanfindMemberTrait(Model model, String traitName) Gets a trait from the member shape or from the shape targeted by the member.Gets the shape in which the member is contained.Get the member name of the member.getMemberTrait(Model model, Class<T> trait) Gets a trait from the member shape or from the shape targeted by the member.Get the targeted member shape ID.getType()Gets the type of the shape.booleanbooleanbooleanbooleanTake this object and create a builder that contains all of the current property values of this object.protected voidMethods inherited from class software.amazon.smithy.model.shapes.Shape
asBigDecimalShape, asBigIntegerShape, asBlobShape, asBooleanShape, asByteShape, asDocumentShape, asDoubleShape, asEnumShape, asFloatShape, asIntegerShape, asIntEnumShape, asListShape, asLongShape, asMapShape, asOperationShape, asResourceShape, asServiceShape, asSetShape, asShortShape, asStringShape, asStructureShape, asTimestampShape, asUnionShape, compareTo, expectTrait, findTrait, findTrait, getAllMembers, getAllTraits, getId, getIntroducedTraits, getMember, getMemberNames, 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
-
Method Details
-
validateMixins
- Overrides:
validateMixinsin classShape
-
builder
-
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<MemberShape>- Returns:
- a builder for type T
-
getContainer
Gets the shape in which the member is contained.- Returns:
- Returns the containing shape id.
-
accept
Description copied from class:ShapeDispatches the shape to the appropriateShapeVisitormethod. -
asMemberShape
- Overrides:
asMemberShapein classShape- Returns:
- Optionally returns the shape as a
MemberShape.
-
getType
Description copied from class:ShapeGets the type of the shape. -
getTarget
Get the targeted member shape ID.- Returns:
- Returns the member shape ID.
-
getMemberName
Get the member name of the member.- Returns:
- Returns the member name.
-
isRequired
public boolean isRequired()- Returns:
- Returns true if the member has the required trait.
-
isOptional
public boolean isOptional()- Returns:
- Returns true if the member is not required.
-
hasNullDefault
public boolean hasNullDefault()- Returns:
- Returns true if the member has a default set explicitly to null.
-
hasNonNullDefault
public boolean hasNonNullDefault()- Returns:
- Returns true if the member has a default not set to null.
-
equals
-
getMemberTrait
Description copied from class:ShapeGets a trait from the member shape or from the shape targeted by the member.If the shape is not a member, then the method functions the same as
Shape.getTrait(Class).- Overrides:
getMemberTraitin classShape- Type Parameters:
T- Trait type to get.- Parameters:
model- Model used to find member targets.trait- Trait type to get.- Returns:
- Returns the optionally found trait on the shape or member.
- See Also:
-
findMemberTrait
Description copied from class:ShapeGets a trait from the member shape or from the shape targeted by the member.If the shape is not a member, then the method functions the same as
Shape.findTrait(String).- Overrides:
findMemberTraitin classShape- Parameters:
model- Model used to find member targets.traitName- Trait name to get.- Returns:
- Returns the optionally found trait on the shape or member.
- See Also:
-