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
-
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, getMember
Methods 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:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceSmithyBuilder<ListShape>
- Overrides:
build
in classListShape.Builder
- Returns:
- an instance of T
-
getShapeType
Description copied from class:AbstractShapeBuilder
Gets the type of shape being built.- Overrides:
getShapeType
in classListShape.Builder
- Returns:
- Returns the shape type.
-
member
Description copied from class:CollectionShape.Builder
Sets the member of the collection.- Overrides:
member
in classCollectionShape.Builder<ListShape.Builder,
ListShape> - Parameters:
member
- Member of the collection to set.- Returns:
- Returns the builder.
-
member
Description copied from class:CollectionShape.Builder
Sets the member of the collection.- Overrides:
member
in classCollectionShape.Builder<ListShape.Builder,
ListShape> - Parameters:
target
- Target of the member.- Returns:
- Returns the builder.
-
member
Description copied from class:CollectionShape.Builder
Sets the member of the collection.- Overrides:
member
in 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:AbstractShapeBuilder
Sets the shape ID of the shape.- Overrides:
id
in classCollectionShape.Builder<ListShape.Builder,
ListShape> - Parameters:
shapeId
- Shape ID to set.- Returns:
- Returns the builder.
-
addMember
Description copied from class:AbstractShapeBuilder
Adds a member to the shape IFF the shape supports members.- Overrides:
addMember
in classCollectionShape.Builder<ListShape.Builder,
ListShape> - Parameters:
member
- Member to add to the shape.- Returns:
- Returns the builder.
-
clearMembers
Description copied from class:AbstractShapeBuilder
Removes all members from the builder.- Overrides:
clearMembers
in classCollectionShape.Builder<ListShape.Builder,
ListShape> - Returns:
- Returns the builder.
-
id
Description copied from class:AbstractShapeBuilder
Sets the shape ID of the shape.- Overrides:
id
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
shapeId
- Absolute shape ID string to set.- Returns:
- Returns the builder.
-
source
Description copied from class:AbstractShapeBuilder
Sets the source location of the shape.- Overrides:
source
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
sourceLocation
- Source location to set.- Returns:
- Returns the builder.
-
source
Description copied from class:AbstractShapeBuilder
Sets the source location of the shape.- Overrides:
source
in 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:AbstractShapeBuilder
Replace all traits in the builder.- Overrides:
traits
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
traitsToSet
- Sequence of traits to set on the builder.- Returns:
- Returns the builder.
-
addTraits
Description copied from class:AbstractShapeBuilder
Adds traits from an iterator to the shape builder, replacing any conflicting traits.- Overrides:
addTraits
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
traitsToAdd
- Sequence of traits to add to the builder.- Returns:
- Returns the builder.
-
addTrait
Description copied from class:AbstractShapeBuilder
Adds a trait to the shape builder, replacing any conflicting traits.- Overrides:
addTrait
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
trait
- Trait instance to add.- Returns:
- Returns the builder.
-
removeTrait
Description copied from class:AbstractShapeBuilder
Removes a trait from the shape builder.A relative trait name will attempt to remove a prelude trait with the given name.
- Overrides:
removeTrait
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
traitId
- Absolute or relative ID of the trait to remove.- Returns:
- Returns the builder.
-
removeTrait
Description copied from class:AbstractShapeBuilder
Removes a trait from the shape builder.- Overrides:
removeTrait
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Parameters:
traitId
- ID of the trait to remove.- Returns:
- Returns the builder.
-
clearTraits
Description copied from class:AbstractShapeBuilder
Removes all traits.- Overrides:
clearTraits
in classAbstractShapeBuilder<ListShape.Builder,
ListShape> - Returns:
- Returns the builder.
-