public class BasicEntityBuilder extends EntityBuilder
General-purpose builder for entities.
id, idSet, type
Constructor and Description |
---|
BasicEntityBuilder(EntityType type)
Create a new entity builder for a type.
|
Modifier and Type | Method and Description |
---|---|
Entity |
build()
Build the entity.
|
EntityBuilder |
clearAttribute(TypedName<?> name)
Clear an attribute.
|
<T> EntityBuilder |
setAttribute(TypedName<T> name,
T val)
Set an attribute in the entity.
|
reset, setAttribute, setDoubleAttribute, setId, setLongAttribute
public BasicEntityBuilder(EntityType type)
Create a new entity builder for a type.
type
- The entity type.public <T> EntityBuilder setAttribute(TypedName<T> name, T val)
EntityBuilder
Set an attribute in the entity.
setAttribute
in class EntityBuilder
name
- The name of the attribute to set.val
- The attribute value.public EntityBuilder clearAttribute(TypedName<?> name)
EntityBuilder
Clear an attribute.
clearAttribute
in class EntityBuilder
name
- The name of the attribute to clear.public Entity build()
EntityBuilder
Build the entity.
build
in class EntityBuilder