public static final class TraitContainer.TraitHashMap extends java.lang.Object implements TraitContainer
TraitContainer.TraitHashMap
EMPTY
Modifier and Type | Method and Description |
---|---|
java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> |
getTraitsAppliedToPrelude()
Gets all traits applied to the prelude.
|
java.util.Map<ShapeId,Trait> |
getTraitsForShape(ShapeId shape)
Gets the traits applied to a shape.
|
void |
onTrait(ShapeId target,
ShapeId traitId,
Node value)
Create and add a trait.
|
void |
onTrait(ShapeId target,
Trait value)
Add a trait.
|
java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> |
traits() |
public java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> traits()
traits
in interface TraitContainer
public java.util.Map<ShapeId,Trait> getTraitsForShape(ShapeId shape)
TraitContainer
getTraitsForShape
in interface TraitContainer
shape
- Shape to get the traits of.public java.util.Map<ShapeId,java.util.Map<ShapeId,Trait>> getTraitsAppliedToPrelude()
TraitContainer
getTraitsAppliedToPrelude
in interface TraitContainer
public void onTrait(ShapeId target, Trait value)
TraitContainer
onTrait
in interface TraitContainer
target
- Shape to add the trait to.value
- Trait to add.public void onTrait(ShapeId target, ShapeId traitId, Node value)
TraitContainer
onTrait
in interface TraitContainer
target
- Shape to add the trait to.traitId
- Trait shape ID to create.value
- The value to assign to the trait.