Interface TraitContainer

All Known Implementing Classes:
TraitContainer.TraitHashMap

public interface TraitContainer
Aggregates, merges, and creates traits.
  • Field Details

    • EMPTY

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

    • traits

      Returns:
      Gets all traits in the value map.
    • getTraitsForShape

      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

      Map<ShapeId,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.