Class MapShape.Builder
- java.lang.Object
-
- software.amazon.smithy.model.shapes.AbstractShapeBuilder<MapShape.Builder,MapShape>
-
- software.amazon.smithy.model.shapes.MapShape.Builder
-
- All Implemented Interfaces:
FromSourceLocation,SmithyBuilder<MapShape>
- Enclosing class:
- MapShape
public static final class MapShape.Builder extends AbstractShapeBuilder<MapShape.Builder,MapShape>
Builder used to create aListShape.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description MapShape.BuilderaddMember(MemberShape member)Adds a member to the shape IFF the shape supports members.MapShapebuild()Creates an immutable object that is created from the properties that have been set on the builder.ShapeTypegetShapeType()Gets the type of shape being built.MapShape.Builderkey(MemberShape member)MapShape.Builderkey(ShapeId target)Sets the key member of the map.MapShape.Builderkey(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)Sets the key member of the map.MapShape.Buildervalue(MemberShape member)MapShape.Buildervalue(ShapeId target)Sets the value member of the map.MapShape.Buildervalue(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)Sets the value member of the map.-
Methods inherited from class software.amazon.smithy.model.shapes.AbstractShapeBuilder
addTrait, addTraits, clearTraits, getId, getSourceLocation, id, id, removeTrait, removeTrait, source, source, traits
-
-
-
-
Method Detail
-
build
public MapShape build()
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Returns:
- an instance of T
-
getShapeType
public ShapeType getShapeType()
Description copied from class:AbstractShapeBuilderGets the type of shape being built.- Specified by:
getShapeTypein classAbstractShapeBuilder<MapShape.Builder,MapShape>- Returns:
- Returns the shape type.
-
key
public MapShape.Builder key(MemberShape member)
-
value
public MapShape.Builder value(MemberShape member)
-
addMember
public MapShape.Builder addMember(MemberShape member)
Description copied from class:AbstractShapeBuilderAdds a member to the shape IFF the shape supports members.- Overrides:
addMemberin classAbstractShapeBuilder<MapShape.Builder,MapShape>- Parameters:
member- Member to add to the shape.- Returns:
- Returns the model assembler.
-
key
public MapShape.Builder key(ShapeId target)
Sets the key member of the map.- Parameters:
target- Target of the member.- Returns:
- Returns the builder.
-
key
public MapShape.Builder key(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the key member of the map.- Parameters:
target- Target of the member.memberUpdater- Consumer that can update the created member shape.- Returns:
- Returns the builder.
-
value
public MapShape.Builder value(ShapeId target)
Sets the value member of the map.- Parameters:
target- Target of the member.- Returns:
- Returns the builder.
-
value
public MapShape.Builder value(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the value member of the map.- Parameters:
target- Target of the member.memberUpdater- Consumer that can updated the created member shape.- Returns:
- Returns the builder.
-
-