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
-
Method Summary
Modifier and TypeMethodDescription<R> R
accept
(ShapeVisitor<R> visitor) Dispatches the shape to the appropriateShapeVisitor
method.static MemberShape.Builder
builder()
boolean
findMemberTrait
(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.boolean
boolean
boolean
boolean
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.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, getRequiredMembers, 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
-
builder
-
toBuilder
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in 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:Shape
Dispatches the shape to the appropriateShapeVisitor
method. -
asMemberShape
- Overrides:
asMemberShape
in classShape
- Returns:
- Optionally returns the shape as a
MemberShape
.
-
getType
Description copied from class:Shape
Gets 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:Shape
Gets 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:
getMemberTrait
in 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:Shape
Gets 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:
findMemberTrait
in 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:
-