public static final class MapShape.Builder extends AbstractShapeBuilder<MapShape.Builder,MapShape>
ListShape
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
MapShape.Builder |
addMember(MemberShape member)
Adds a member to the shape IFF the shape supports members.
|
MapShape |
build() |
MapShape.Builder |
clearMembers()
Removes all members from the builder.
|
MapShape.Builder |
flattenMixins()
Removes mixins from a shape and flattens them into the shape.
|
ShapeType |
getShapeType()
Gets the type of shape being built.
|
MapShape.Builder |
id(ShapeId shapeId)
Sets the shape ID of the shape.
|
MapShape.Builder |
key(MemberShape member) |
MapShape.Builder |
key(ShapeId target)
Sets the key member of the map.
|
MapShape.Builder |
key(ShapeId target,
java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the key member of the map.
|
MapShape.Builder |
value(MemberShape member) |
MapShape.Builder |
value(ShapeId target)
Sets the value member of the map.
|
MapShape.Builder |
value(ShapeId target,
java.util.function.Consumer<MemberShape.Builder> memberUpdater)
Sets the value member of the map.
|
addMixin, addTrait, addTraits, clearMixins, clearTraits, getAllTraits, getId, getSourceLocation, id, mixins, removeMixin, removeTrait, removeTrait, source, source, traits
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compare
public MapShape build()
public ShapeType getShapeType()
AbstractShapeBuilder
getShapeType
in class AbstractShapeBuilder<MapShape.Builder,MapShape>
public MapShape.Builder id(ShapeId shapeId)
AbstractShapeBuilder
id
in class AbstractShapeBuilder<MapShape.Builder,MapShape>
shapeId
- Shape ID to set.public MapShape.Builder key(MemberShape member)
public MapShape.Builder value(MemberShape member)
public MapShape.Builder addMember(MemberShape member)
AbstractShapeBuilder
addMember
in class AbstractShapeBuilder<MapShape.Builder,MapShape>
member
- Member to add to the shape.public MapShape.Builder clearMembers()
AbstractShapeBuilder
clearMembers
in class AbstractShapeBuilder<MapShape.Builder,MapShape>
public MapShape.Builder key(ShapeId target)
target
- Target of the member.public MapShape.Builder key(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
target
- Target of the member.memberUpdater
- Consumer that can update the created member shape.public MapShape.Builder value(ShapeId target)
target
- Target of the member.public MapShape.Builder value(ShapeId target, java.util.function.Consumer<MemberShape.Builder> memberUpdater)
target
- Target of the member.memberUpdater
- Consumer that can updated the created member shape.public MapShape.Builder flattenMixins()
AbstractShapeBuilder
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.
flattenMixins
in class AbstractShapeBuilder<MapShape.Builder,MapShape>