public class EntityAndAttribute<T>
extends java.lang.Object
implements com.google.common.base.Supplier<T>
Entity
and an AttributeSensor
, which is assumed to be present on the entity.
Allows retrieval of the attribute value
or can be used instead where a Supplier
for
the attribute value is required.
Constructor and Description |
---|
EntityAndAttribute(Entity entity,
AttributeSensor<T> attribute) |
Modifier and Type | Method and Description |
---|---|
static <T> EntityAndAttribute<T> |
create(Entity entity,
AttributeSensor<T> attribute) |
boolean |
equals(java.lang.Object o) |
T |
get()
|
AttributeSensor<T> |
getAttribute() |
Entity |
getEntity() |
T |
getValue() |
int |
hashCode() |
void |
setValue(T val) |
static <T> EntityAndAttribute<T> |
supplier(Entity entity,
AttributeSensor<T> attribute)
Deprecated.
since 0.7.0; use
create(Entity, AttributeSensor) ; this does not relate to Supplier |
java.lang.String |
toString() |
public EntityAndAttribute(Entity entity, AttributeSensor<T> attribute)
public static <T> EntityAndAttribute<T> create(Entity entity, AttributeSensor<T> attribute)
public static <T> EntityAndAttribute<T> supplier(Entity entity, AttributeSensor<T> attribute)
public Entity getEntity()
public AttributeSensor<T> getAttribute()
public T getValue()
public void setValue(T val)
public T get()
get
in interface com.google.common.base.Supplier<T>
getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object