Class UnionShape

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

    public final class UnionShape
    extends Shape
    implements software.amazon.smithy.utils.ToSmithyBuilder<UnionShape>
    Tagged union shape that maps member names to member definitions.
    • Method Detail

      • toBuilder

        public UnionShape.Builder toBuilder()
        Specified by:
        toBuilder in interface software.amazon.smithy.utils.ToSmithyBuilder<UnionShape>
      • accept

        public <R> R accept​(ShapeVisitor<R> cases)
        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:
        cases - NeighborVisitor to use.
        Returns:
        Returns the result.
      • 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 a list of member names.
        Returns:
        Returns list of member names.
      • getMember

        public java.util.Optional<MemberShape> getMember​(java.lang.String name)
        Get a specific member by name.
        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