Interface TraitContainer
- All Known Implementing Classes:
TraitContainer.TraitHashMap
public interface TraitContainer
Aggregates, merges, and creates traits.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
The actual, mutable implementation used to aggregate traits. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGets all traits applied to the prelude.getTraitsForShape
(ShapeId shape) Gets the traits applied to a shape.void
Create and add a trait.void
Add a trait.traits()
-
Field Details
-
EMPTY
Shared empty, immutable instance.
-
-
Method Details
-
traits
- Returns:
- Gets all traits in the value map.
-
getTraitsForShape
Gets the traits applied to a shape.- Parameters:
shape
- Shape to get the traits of.- Returns:
- Returns the traits of the shape.
-
getTraitsAppliedToPrelude
Gets all traits applied to the prelude.- Returns:
- Returns the traits applied to prelude shapes.
-
onTrait
Add a trait.- Parameters:
target
- Shape to add the trait to.value
- Trait to add.
-
onTrait
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.
-