public static final class StructureShape.Builder extends AbstractShapeBuilder<B,S>
StructureShape
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
B |
addMember(MemberShape member)
Adds a member to the builder.
|
B |
addMember(java.lang.String memberName,
ShapeId target)
Adds a member to the builder.
|
B |
addMember(java.lang.String memberName,
ShapeId target,
java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Adds a member to the builder.
|
StructureShape |
build()
Creates an immutable object that is created from the properties
that have been set on the builder.
|
B |
clearMembers()
Removes all members from the shape.
|
ShapeType |
getShapeType()
Gets the type of shape being built.
|
B |
id(ShapeId shapeId)
Sets the shape ID of the shape.
|
B |
members(java.util.Collection<MemberShape> members)
Replaces the members of the builder.
|
B |
removeMember(java.lang.String member)
Removes a member by name.
|
addTrait, addTraits, clearTraits, getId, getSourceLocation, id, removeTrait, removeTrait, source, source, traits
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
requiredState
public StructureShape build()
SmithyBuilder
public ShapeType getShapeType()
AbstractShapeBuilder
getShapeType
in class AbstractShapeBuilder<StructureShape.Builder,StructureShape>
public final B id(ShapeId shapeId)
AbstractShapeBuilder
id
in class AbstractShapeBuilder<B extends software.amazon.smithy.model.shapes.NamedMembersShape.Builder<?,?>,S extends software.amazon.smithy.model.shapes.NamedMembersShape>
shapeId
- Shape ID to set.public B members(java.util.Collection<MemberShape> members)
members
- Members to add to the builder.public B clearMembers()
public B addMember(MemberShape member)
addMember
in class AbstractShapeBuilder<B extends software.amazon.smithy.model.shapes.NamedMembersShape.Builder<?,?>,S extends software.amazon.smithy.model.shapes.NamedMembersShape>
member
- Shape targeted by the member.public B addMember(java.lang.String memberName, ShapeId target)
memberName
- Member name to add.target
- Target of the member.public B addMember(java.lang.String memberName, ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
memberName
- Member name to add.target
- Target of the member.memberUpdater
- Consumer that can update the created member shape.public B removeMember(java.lang.String member)
member
- Member name to remove.