Interface TraitContainer

    • Field Detail

      • EMPTY

        static final TraitContainer EMPTY
        Shared empty, immutable instance.
    • Method Detail

      • traits

        java.util.Map<ShapeId,​java.util.Map<ShapeId,​Trait>> traits()
        Returns:
        Gets all traits in the value map.
      • getTraitsForShape

        java.util.Map<ShapeId,​Trait> getTraitsForShape​(ShapeId shape)
        Gets the traits applied to a shape.
        Parameters:
        shape - Shape to get the traits of.
        Returns:
        Returns the traits of the shape.
      • getTraitsAppliedToPrelude

        java.util.Map<ShapeId,​java.util.Map<ShapeId,​Trait>> getTraitsAppliedToPrelude()
        Gets all traits applied to the prelude.
        Returns:
        Returns the traits applied to prelude shapes.
      • onTrait

        void onTrait​(ShapeId target,
                     Trait value)
        Add a trait.
        Parameters:
        target - Shape to add the trait to.
        value - Trait to add.
      • onTrait

        void onTrait​(ShapeId target,
                     ShapeId traitId,
                     Node value)
        Create and add a trait.
        Parameters:
        target - Shape to add the trait to.
        traitId - Trait shape ID to create.
        value - The value to assign to the trait.