@Beta public class AddSensor<T> extends java.lang.Object implements EntityInitializer
AttributeSensor on an entity.
The configuration can include the sensor name, period and targetType.
For the targetType, currently this only supports classes on the initial classpath, not those in
OSGi bundles added at runtime.
| Modifier and Type | Field and Description |
|---|---|
static ConfigKey<java.lang.String> |
SENSOR_NAME |
static ConfigKey<Duration> |
SENSOR_PERIOD |
static ConfigKey<java.lang.String> |
SENSOR_TYPE |
| Constructor and Description |
|---|
AddSensor(ConfigBag params) |
AddSensor(java.util.Map<java.lang.String,java.lang.String> params) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(EntityLocal entity)
Applies initialization logic to a just-built entity.
|
public static final ConfigKey<java.lang.String> SENSOR_NAME
public static final ConfigKey<java.lang.String> SENSOR_TYPE
public AddSensor(java.util.Map<java.lang.String,java.lang.String> params)
public AddSensor(ConfigBag params)
public void apply(EntityLocal entity)
EntityInitializerapply in interface EntityInitializerentity - guaranteed to be the actual implementation instance,
thus guaranteed to be castable to EntityInternal which is often desired,
or to the type at hand (it is not even a proxy)