Class SetShape.Builder
java.lang.Object
software.amazon.smithy.model.shapes.AbstractShapeBuilder<B,S>
software.amazon.smithy.model.shapes.CollectionShape.Builder<ListShape.Builder,ListShape>
software.amazon.smithy.model.shapes.ListShape.Builder
software.amazon.smithy.model.shapes.SetShape.Builder
- All Implemented Interfaces:
FromSourceLocation,SmithyBuilder<ListShape>
- Enclosing class:
- SetShape
Builder used to create a
SetShape.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMember(MemberShape member) Adds a member to the shape IFF the shape supports members.Adds a trait to the shape builder, replacing any conflicting traits.addTraits(Collection<? extends Trait> traitsToAdd) Adds traits from an iterator to the shape builder, replacing any conflicting traits.build()Creates an immutable object that is created from the properties that have been set on the builder.Removes all members from the builder.Removes all traits.Gets the type of shape being built.Sets the shape ID of the shape.Sets the shape ID of the shape.member(MemberShape member) Sets the member of the collection.Sets the member of the collection.member(ShapeId target, Consumer<MemberShape.Builder> memberUpdater) Sets the member of the collection.removeTrait(String traitId) Removes a trait from the shape builder.removeTrait(ShapeId traitId) Removes a trait from the shape builder.Sets the source location of the shape.source(SourceLocation sourceLocation) Sets the source location of the shape.traits(Collection<Trait> traitsToSet) Replace all traits in the builder.Methods inherited from class software.amazon.smithy.model.shapes.CollectionShape.Builder
flattenMixins, getMemberMethods inherited from class software.amazon.smithy.model.shapes.AbstractShapeBuilder
addMixin, clearMixins, getAllTraits, getId, getSourceLocation, mixins, removeMixin
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Specified by:
buildin interfaceSmithyBuilder<ListShape>- Overrides:
buildin classListShape.Builder- Returns:
- an instance of T
-
getShapeType
Description copied from class:AbstractShapeBuilderGets the type of shape being built.- Overrides:
getShapeTypein classListShape.Builder- Returns:
- Returns the shape type.
-
member
Description copied from class:CollectionShape.BuilderSets the member of the collection.- Overrides:
memberin classCollectionShape.Builder<ListShape.Builder,ListShape> - Parameters:
member- Member of the collection to set.- Returns:
- Returns the builder.
-
member
Description copied from class:CollectionShape.BuilderSets the member of the collection.- Overrides:
memberin classCollectionShape.Builder<ListShape.Builder,ListShape> - Parameters:
target- Target of the member.- Returns:
- Returns the builder.
-
member
Description copied from class:CollectionShape.BuilderSets the member of the collection.- Overrides:
memberin classCollectionShape.Builder<ListShape.Builder,ListShape> - Parameters:
target- Target of the member.memberUpdater- Consumer that can update the created member shape.- Returns:
- Returns the builder.
-
id
Description copied from class:AbstractShapeBuilderSets the shape ID of the shape.- Overrides:
idin classCollectionShape.Builder<ListShape.Builder,ListShape> - Parameters:
shapeId- Shape ID to set.- Returns:
- Returns the builder.
-
addMember
Description copied from class:AbstractShapeBuilderAdds a member to the shape IFF the shape supports members.- Overrides:
addMemberin classCollectionShape.Builder<ListShape.Builder,ListShape> - Parameters:
member- Member to add to the shape.- Returns:
- Returns the builder.
-
clearMembers
Description copied from class:AbstractShapeBuilderRemoves all members from the builder.- Overrides:
clearMembersin classCollectionShape.Builder<ListShape.Builder,ListShape> - Returns:
- Returns the builder.
-
id
Description copied from class:AbstractShapeBuilderSets the shape ID of the shape.- Overrides:
idin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
shapeId- Absolute shape ID string to set.- Returns:
- Returns the builder.
-
source
Description copied from class:AbstractShapeBuilderSets the source location of the shape.- Overrides:
sourcein classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
sourceLocation- Source location to set.- Returns:
- Returns the builder.
-
source
Description copied from class:AbstractShapeBuilderSets the source location of the shape.- Overrides:
sourcein classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
filename- Name of the file in which the shape was defined.line- Line number in the file where the shape was defined.column- Column number of the line where the shape was defined.- Returns:
- Returns the builder.
-
traits
Description copied from class:AbstractShapeBuilderReplace all traits in the builder.- Overrides:
traitsin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
traitsToSet- Sequence of traits to set on the builder.- Returns:
- Returns the builder.
-
addTraits
Description copied from class:AbstractShapeBuilderAdds traits from an iterator to the shape builder, replacing any conflicting traits.- Overrides:
addTraitsin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
traitsToAdd- Sequence of traits to add to the builder.- Returns:
- Returns the builder.
-
addTrait
Description copied from class:AbstractShapeBuilderAdds a trait to the shape builder, replacing any conflicting traits.- Overrides:
addTraitin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
trait- Trait instance to add.- Returns:
- Returns the builder.
-
removeTrait
Description copied from class:AbstractShapeBuilderRemoves a trait from the shape builder.A relative trait name will attempt to remove a prelude trait with the given name.
- Overrides:
removeTraitin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
traitId- Absolute or relative ID of the trait to remove.- Returns:
- Returns the builder.
-
removeTrait
Description copied from class:AbstractShapeBuilderRemoves a trait from the shape builder.- Overrides:
removeTraitin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Parameters:
traitId- ID of the trait to remove.- Returns:
- Returns the builder.
-
clearTraits
Description copied from class:AbstractShapeBuilderRemoves all traits.- Overrides:
clearTraitsin classAbstractShapeBuilder<ListShape.Builder,ListShape> - Returns:
- Returns the builder.
-