public static final class ModelSerializer.Builder extends java.lang.Object implements SmithyBuilder<ModelSerializer>
ModelSerializer
.Modifier and Type | Method and Description |
---|---|
ModelSerializer |
build()
Creates an immutable object that is created from the properties
that have been set on the builder.
|
ModelSerializer.Builder |
includePrelude(boolean includePrelude)
Enables or disables including the prelude in the serialized model.
|
ModelSerializer.Builder |
metadataFilter(java.util.function.Predicate<java.lang.String> metadataFilter)
Predicate that determines if a metadata is serialized.
|
ModelSerializer.Builder |
shapeFilter(java.util.function.Predicate<Shape> shapeFilter)
Predicate that determines if a shape and its traits are serialized.
|
ModelSerializer.Builder |
traitFilter(java.util.function.Predicate<Trait> traitFilter)
Sets a predicate that can be used to filter trait values from
appearing in the serialized model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
requiredState
public ModelSerializer.Builder metadataFilter(java.util.function.Predicate<java.lang.String> metadataFilter)
metadataFilter
- Predicate that accepts a metadata key.public ModelSerializer.Builder shapeFilter(java.util.function.Predicate<Shape> shapeFilter)
shapeFilter
- Predicate that accepts a shape.public ModelSerializer.Builder includePrelude(boolean includePrelude)
By default, the prelude is not included.
This should nearly always be left at default, as per the spec the prelude is inherently part of every model, and so any Smithy implementation must build in an understanding of the prelude. Disabling this filter can be useful for those implementations to allow them to build their understanding of it from a JSON version of the prelude.
includePrelude
- boolean indicating whether the prelude should be included or not.public ModelSerializer.Builder traitFilter(java.util.function.Predicate<Trait> traitFilter)
Note that this does not filter out trait definitions. It only filters out instances of traits from being serialized on shapes.
traitFilter
- Predicate that filters out trait definitions.public ModelSerializer build()
SmithyBuilder
build
in interface SmithyBuilder<ModelSerializer>