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
public static final class SetShape.Builder extends ListShape.Builder
Builder used to create aSetShape.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SetShape.BuilderaddMember(MemberShape member)Adds a member to the shape IFF the shape supports members.SetShape.BuilderaddTrait(Trait trait)Adds a trait to the shape builder, replacing any conflicting traits.SetShape.BuilderaddTraits(java.util.Collection<? extends Trait> traitsToAdd)Adds traits from an iterator to the shape builder, replacing any conflicting traits.SetShapebuild()Creates an immutable object that is created from the properties that have been set on the builder.SetShape.BuilderclearMembers()Removes all members from the builder.SetShape.BuilderclearTraits()Removes all traits.ShapeTypegetShapeType()Gets the type of shape being built.SetShape.Builderid(java.lang.String shapeId)Sets the shape ID of the shape.SetShape.Builderid(ShapeId shapeId)Sets the shape ID of the shape.SetShape.Buildermember(MemberShape member)Sets the member of the collection.SetShape.Buildermember(ShapeId target)Sets the member of the collection.SetShape.Buildermember(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)Sets the member of the collection.SetShape.BuilderremoveTrait(java.lang.String traitId)Removes a trait from the shape builder.SetShape.BuilderremoveTrait(ShapeId traitId)Removes a trait from the shape builder.SetShape.Buildersource(java.lang.String filename, int line, int column)Sets the source location of the shape.SetShape.Buildersource(SourceLocation sourceLocation)Sets the source location of the shape.SetShape.Buildertraits(java.util.Collection<Trait> traitsToSet)Replace all traits in the builder.-
Methods inherited from class software.amazon.smithy.model.shapes.CollectionShape.Builder
flattenMixins
-
Methods inherited from class software.amazon.smithy.model.shapes.AbstractShapeBuilder
addMixin, clearMixins, getAllTraits, getId, getSourceLocation, mixins, removeMixin
-
-
-
-
Method Detail
-
build
public SetShape 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
public ShapeType getShapeType()
Description copied from class:AbstractShapeBuilderGets the type of shape being built.- Overrides:
getShapeTypein classListShape.Builder- Returns:
- Returns the shape type.
-
member
public SetShape.Builder member(MemberShape 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
public SetShape.Builder member(ShapeId target)
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
public SetShape.Builder member(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
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
public SetShape.Builder id(ShapeId shapeId)
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
public SetShape.Builder addMember(MemberShape member)
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
public SetShape.Builder clearMembers()
Description copied from class:AbstractShapeBuilderRemoves all members from the builder.- Overrides:
clearMembersin classCollectionShape.Builder<ListShape.Builder,ListShape>- Returns:
- Returns the builder.
-
id
public SetShape.Builder id(java.lang.String shapeId)
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
public SetShape.Builder source(SourceLocation sourceLocation)
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
public SetShape.Builder source(java.lang.String filename, int line, int column)
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
public SetShape.Builder traits(java.util.Collection<Trait> traitsToSet)
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
public SetShape.Builder addTraits(java.util.Collection<? extends Trait> traitsToAdd)
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
public SetShape.Builder addTrait(Trait trait)
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
public SetShape.Builder removeTrait(java.lang.String traitId)
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
public SetShape.Builder removeTrait(ShapeId traitId)
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
public SetShape.Builder clearTraits()
Description copied from class:AbstractShapeBuilderRemoves all traits.- Overrides:
clearTraitsin classAbstractShapeBuilder<ListShape.Builder,ListShape>- Returns:
- Returns the builder.
-
-