Class StructureShape

  • All Implemented Interfaces:
    java.lang.Comparable<Shape>, FromSourceLocation, ToShapeId, software.amazon.smithy.utils.Tagged, software.amazon.smithy.utils.ToSmithyBuilder<StructureShape>

    public final class StructureShape
    extends Shape
    implements software.amazon.smithy.utils.ToSmithyBuilder<StructureShape>
    Structure shape that maps shape names to members.
    • Method Detail

      • accept

        public <R> R accept​(ShapeVisitor<R> visitor)
        Description copied from class: Shape
        Dispatches the shape to the appropriate ShapeVisitor method.
        Specified by:
        accept in class Shape
        Type Parameters:
        R - Return type of the accept.
        Parameters:
        visitor - ShapeVisitor to use.
        Returns:
        Returns the result.
      • getType

        public ShapeType getType()
        Description copied from class: Shape
        Gets the type of the shape.
        Specified by:
        getType in class Shape
        Returns:
        Returns the type;
      • getAllMembers

        public java.util.Map<java.lang.String,​MemberShape> getAllMembers()
        Gets the members of the shape.
        Returns:
        Returns the immutable member map.
      • getMemberNames

        public java.util.List<java.lang.String> getMemberNames()
        Returns an ordered list of member names based on the order they are defined in the model.
        Returns:
        Returns an immutable list of member names.
      • getMember

        public final java.util.Optional<MemberShape> getMember​(java.lang.String name)
        Description copied from class: Shape
        Get a specific member by name.

        Shapes with no members return an empty Optional.

        Overrides:
        getMember in class Shape
        Parameters:
        name - Name of the member to retrieve.
        Returns:
        Returns the optional member.
      • members

        public java.util.Collection<MemberShape> members()
        Description copied from class: Shape
        Gets all of the members contained in the shape.
        Overrides:
        members in class Shape
        Returns:
        Returns the members contained in the shape (if any).
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class Shape