Class ModelSerializer.Builder

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ModelSerializer build()
      Creates an immutable object that is created from the properties that have been set on the builder.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • metadataFilter

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

        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.