Class SmithyIdlModelSerializer.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • metadataFilter

        public SmithyIdlModelSerializer.Builder metadataFilter​(java.util.function.Predicate<java.lang.String> metadataFilter)
        Predicate that determines if a metadata is serialized.
        Parameters:
        metadataFilter - Predicate that accepts a metadata key.
        Returns:
        Returns the builder.
      • shapeFilter

        public SmithyIdlModelSerializer.Builder shapeFilter​(java.util.function.Predicate<Shape> shapeFilter)
        Predicate that determines if a shape and its traits are serialized.
        Parameters:
        shapeFilter - Predicate that accepts a shape.
        Returns:
        Returns the builder.
      • traitFilter

        public SmithyIdlModelSerializer.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.

        Note that this does not filter out trait definitions. It only filters out instances of traits from being serialized on shapes.

        Parameters:
        traitFilter - Predicate that filters out trait definitions.
        Returns:
        Returns the builder.
      • shapePlacer

        public SmithyIdlModelSerializer.Builder shapePlacer​(java.util.function.Function<Shape,​java.nio.file.Path> shapePlacer)
        Function that determines what output file a shape should go in.

        The returned paths may be absolute or relative.

        NOTE: the Smithy IDL only supports one namespace per file.

        Parameters:
        shapePlacer - Function that accepts a shape and returns file path.
        Returns:
        Returns the builder.
      • basePath

        public SmithyIdlModelSerializer.Builder basePath​(java.nio.file.Path basePath)
        A base path to use for any created models.
        Parameters:
        basePath - The base directory to assign models to.
        Returns:
        Returns the builder.