Class CollectionShape.Builder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- java.lang.Object
-
- software.amazon.smithy.model.shapes.AbstractShapeBuilder<B,S>
-
- software.amazon.smithy.model.shapes.CollectionShape.Builder<B,S>
-
- Type Parameters:
B
- Concrete builder type.S
- Shape type being created.
- All Implemented Interfaces:
FromSourceLocation
,SmithyBuilder<S>
- Direct Known Subclasses:
ListShape.Builder
- Enclosing class:
- CollectionShape
public abstract static class CollectionShape.Builder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape> extends AbstractShapeBuilder<B,S>
Builder used to create a List or Set shape.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B
addMember(MemberShape member)
Adds a member to the shape IFF the shape supports members.B
clearMembers()
Removes all members from the builder.B
flattenMixins()
Removes mixins from a shape and flattens them into the shape.java.util.Optional<MemberShape>
getMember(java.lang.String memberName)
Gets the optional member with the given name.B
id(ShapeId shapeId)
Sets the shape ID of the shape.B
member(MemberShape member)
Sets the member of the collection.B
member(ShapeId target)
Sets the member of the collection.B
member(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the member of the collection.-
Methods inherited from class software.amazon.smithy.model.shapes.AbstractShapeBuilder
addMixin, addTrait, addTraits, clearMixins, clearTraits, getAllTraits, getId, getShapeType, getSourceLocation, id, mixins, removeMixin, removeTrait, removeTrait, source, source, traits
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.utils.SmithyBuilder
build
-
-
-
-
Method Detail
-
getMember
public java.util.Optional<MemberShape> getMember(java.lang.String memberName)
Description copied from class:AbstractShapeBuilder
Gets the optional member with the given name.- Overrides:
getMember
in classAbstractShapeBuilder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- Returns:
- Returns the optional member with the given name.
-
id
public B id(ShapeId shapeId)
Description copied from class:AbstractShapeBuilder
Sets the shape ID of the shape.- Overrides:
id
in classAbstractShapeBuilder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- Parameters:
shapeId
- Shape ID to set.- Returns:
- Returns the builder.
-
member
public B member(MemberShape member)
Sets the member of the collection.- Parameters:
member
- Member of the collection to set.- Returns:
- Returns the builder.
-
member
public B member(ShapeId target)
Sets the member of the collection.- Parameters:
target
- Target of the member.- Returns:
- Returns the builder.
-
member
public B member(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the member of the collection.- Parameters:
target
- Target of the member.memberUpdater
- Consumer that can update the created member shape.- Returns:
- Returns the builder.
-
addMember
public B addMember(MemberShape member)
Description copied from class:AbstractShapeBuilder
Adds a member to the shape IFF the shape supports members.- Overrides:
addMember
in classAbstractShapeBuilder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- Parameters:
member
- Member to add to the shape.- Returns:
- Returns the builder.
-
clearMembers
public B clearMembers()
Description copied from class:AbstractShapeBuilder
Removes all members from the builder.- Overrides:
clearMembers
in classAbstractShapeBuilder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- Returns:
- Returns the builder.
-
flattenMixins
public B flattenMixins()
Description copied from class:AbstractShapeBuilder
Removes mixins from a shape and flattens them into the shape.Flattening a mixin into a shape copies the traits and members of a mixin onto the shape, effectively resulting in the same shape but with no trace of the mixin relationship.
- Overrides:
flattenMixins
in classAbstractShapeBuilder<B extends CollectionShape.Builder<B,S>,S extends CollectionShape>
- Returns:
- Returns the updated builder.
-
-