@Test public void testAttribute() throws Exception { entity.sensors().set(TestEntity.NAME, "myname"); assertEquals(EntityFunctions.attribute(TestEntity.NAME).apply(entity), "myname"); assertNull(EntityFunctions.attribute(TestEntity.SEQUENCE).apply(entity)); }
public static <T> Function<Entity, T> attribute(AttributeSensor<T> attribute) { return new GetEntityAttributeFunction<T>(checkNotNull(attribute, "attribute")); }
EntityFunctions { public static <T> Function<Entity, T> attribute(AttributeSensor<T> attribute) { return new GetEntityAttributeFunction<T>(checkNotNull(attribute, "attribute")); } }
EntityFunctions { public static <T> Function<Entity, T> attribute(AttributeSensor<T> attribute) { return new GetEntityAttributeFunction<T>(checkNotNull(attribute, "attribute")); }  }
EntityFunctions { public static <T> Function<Entity, T> attribute(AttributeSensor<T> attribute) { return new GetEntityAttributeFunction<T>(checkNotNull(attribute, "attribute")); }  static Function<Entity, T> attribute(AttributeSensor<T> attribute); static Function<Object, T> attribute(Entity entity, AttributeSensor<T> attribute); static Function<Entity, T> config(ConfigKey<T> key); static Function<Entity, String> displayName(); static Function<Identifiable, String> id(); static Function<Entity,Void> settingSensorsConstant(final Map<AttributeSensor<?>,Object> values); static Runnable settingSensorsConstant(final Entity entity, final Map<AttributeSensor<?>,Object> values); static Function<Entity, Void> updatingSensorMapEntry(final AttributeSensor<Map<K,V>> mapSensor, final K key, final Supplier<? extends V> valueSupplier); static Runnable updatingSensorMapEntry(final Entity entity, final AttributeSensor<Map<K,V>> mapSensor, final K key, final Supplier<? extends V> valueSupplier); static Supplier<Collection<Application>> applications(ManagementContext mgmt); static Function<Entity, Location> locationMatching(Predicate<? super Location> filter); }
EntityFunctions { public static <T> Function<Entity, T> attribute(AttributeSensor<T> attribute) { return new GetEntityAttributeFunction<T>(checkNotNull(attribute, "attribute")); }  static Function<Entity, T> attribute(AttributeSensor<T> attribute); static Function<Object, T> attribute(Entity entity, AttributeSensor<T> attribute); static Function<Entity, T> config(ConfigKey<T> key); static Function<Entity, String> displayName(); static Function<Identifiable, String> id(); static Function<Entity,Void> settingSensorsConstant(final Map<AttributeSensor<?>,Object> values); static Runnable settingSensorsConstant(final Entity entity, final Map<AttributeSensor<?>,Object> values); static Function<Entity, Void> updatingSensorMapEntry(final AttributeSensor<Map<K,V>> mapSensor, final K key, final Supplier<? extends V> valueSupplier); static Runnable updatingSensorMapEntry(final Entity entity, final AttributeSensor<Map<K,V>> mapSensor, final K key, final Supplier<? extends V> valueSupplier); static Supplier<Collection<Application>> applications(ManagementContext mgmt); static Function<Entity, Location> locationMatching(Predicate<? super Location> filter);  }