test_class.declarator: events
test_class.modifier: private
test_class.original_string: private List<Object> events;
test_class.type: List<Object>
test_class.var_name: events
test_class.declarator: loc
test_class.modifier: private
test_class.original_string: private Location loc;
test_class.type: Location
test_class.var_name: loc
test_class.file: common/src/test/java/brooklyn/networking/AttributeMungerTest.java
test_class.identifier: AttributeMungerTest
test_class.superclass: extends BrooklynAppUnitTestSupport
test_case.body: @Test(groups="Integration") // has a sleep for equalsContinually
      public void testSetAttributeIfChanged() throws Exception {
          AttributeMunger.setAttributeIfChanged(new EntityAndAttribute<String>(app, TestApplication.MY_ATTRIBUTE), "val1");
          assertEquals(app.getAttribute(TestApplication.MY_ATTRIBUTE), "val1");
          assertEquals(events, ImmutableList.of("val1"), "actual="+events);
  
          AttributeMunger.setAttributeIfChanged(new EntityAndAttribute<String>(app, TestApplication.MY_ATTRIBUTE), "val1");
          assertEqualsContinually(events, ImmutableList.of("val1"));
          assertEquals(app.getAttribute(TestApplication.MY_ATTRIBUTE), "val1");
  
          AttributeMunger.setAttributeIfChanged(new EntityAndAttribute<String>(app, TestApplication.MY_ATTRIBUTE), "val2");
          assertEquals(app.getAttribute(TestApplication.MY_ATTRIBUTE), "val2");
          assertEqualsEventually(events, ImmutableList.of("val1", "val2"));
      }
test_case.class_method_signature: AttributeMungerTest.testSetAttributeIfChanged()
test_case.full_signature: @Test(groups="Integration") // has a sleep for equalsContinually public void testSetAttributeIfChanged()
test_case.identifier: testSetAttributeIfChanged
test_case.invocations: setAttributeIfChanged assertEquals getAttribute assertEquals of setAttributeIfChanged assertEqualsContinually of assertEquals getAttribute setAttributeIfChanged assertEquals getAttribute assertEqualsEventually of
test_case.modifiers: @Test(groups="Integration") // has a sleep for equalsContinually public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetAttributeIfChanged()
focal_class.declarator: log = LoggerFactory.getLogger(AttributeMunger.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(AttributeMunger.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: adjunctEntity
focal_class.modifier: private final
focal_class.original_string: private final Entity adjunctEntity;
focal_class.type: Entity
focal_class.var_name: adjunctEntity
focal_class.file: common/src/main/java/brooklyn/networking/AttributeMunger.java
focal_class.identifier: AttributeMunger
focal_class.class_method_signature: AttributeMunger.AttributeMunger(Entity adjunctEntity)
focal_class.full_signature: public  AttributeMunger(Entity adjunctEntity)
focal_class.identifier: AttributeMunger
focal_class.modifiers: public
focal_class.parameters: (Entity adjunctEntity)
focal_class.signature:  AttributeMunger(Entity adjunctEntity)
focal_class.class_method_signature: AttributeMunger.transformSensorStringReplacingWithPublicAddressAndPort(
              final EntityAndAttribute<String> targetToUpdate,
              final Optional<EntityAndAttribute<Integer>> optionalTargetPort,
              final Iterable<? extends AttributeSensor<String>> targetsToMatch,
              final EntityAndAttribute<String> replacementSource)
focal_class.full_signature: public void transformSensorStringReplacingWithPublicAddressAndPort(
              final EntityAndAttribute<String> targetToUpdate,
              final Optional<EntityAndAttribute<Integer>> optionalTargetPort,
              final Iterable<? extends AttributeSensor<String>> targetsToMatch,
              final EntityAndAttribute<String> replacementSource)
focal_class.identifier: transformSensorStringReplacingWithPublicAddressAndPort
focal_class.modifiers: public
focal_class.parameters: (
              final EntityAndAttribute<String> targetToUpdate,
              final Optional<EntityAndAttribute<Integer>> optionalTargetPort,
              final Iterable<? extends AttributeSensor<String>> targetsToMatch,
              final EntityAndAttribute<String> replacementSource)
focal_class.return: void
focal_class.signature: void transformSensorStringReplacingWithPublicAddressAndPort(
              final EntityAndAttribute<String> targetToUpdate,
              final Optional<EntityAndAttribute<Integer>> optionalTargetPort,
              final Iterable<? extends AttributeSensor<String>> targetsToMatch,
              final EntityAndAttribute<String> replacementSource)
focal_class.class_method_signature: AttributeMunger.replaceIfNotNull(String string, String searchFor, String replaceWith)
focal_class.full_signature: public static String replaceIfNotNull(String string, String searchFor, String replaceWith)
focal_class.identifier: replaceIfNotNull
focal_class.modifiers: public static
focal_class.parameters: (String string, String searchFor, String replaceWith)
focal_class.return: String
focal_class.signature: String replaceIfNotNull(String string, String searchFor, String replaceWith)
focal_class.class_method_signature: AttributeMunger.setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)
focal_class.full_signature: public static void setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)
focal_class.identifier: setAttributeIfChanged
focal_class.modifiers: public static
focal_class.parameters: (EntityAndAttribute<T> entityAndAttribute, T val)
focal_class.return: void
focal_class.signature: void setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)
focal_class.class_method_signature: AttributeMunger.setAttributeIfChanged(Entity entity, AttributeSensor<T> attribute, T val)
focal_class.full_signature: public static void setAttributeIfChanged(Entity entity, AttributeSensor<T> attribute, T val)
focal_class.identifier: setAttributeIfChanged
focal_class.modifiers: public static
focal_class.parameters: (Entity entity, AttributeSensor<T> attribute, T val)
focal_class.return: void
focal_class.signature: void setAttributeIfChanged(Entity entity, AttributeSensor<T> attribute, T val)
focal_class.class_method_signature: AttributeMunger.subscribe(Entity target, AttributeSensor<T> sensor, SensorEventListener<? super T> listener)
focal_class.full_signature: private void subscribe(Entity target, AttributeSensor<T> sensor, SensorEventListener<? super T> listener)
focal_class.identifier: subscribe
focal_class.modifiers: private
focal_class.parameters: (Entity target, AttributeSensor<T> sensor, SensorEventListener<? super T> listener)
focal_class.return: void
focal_class.signature: void subscribe(Entity target, AttributeSensor<T> sensor, SensorEventListener<? super T> listener)
focal_method.body: public static <T> void setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val) {
          setAttributeIfChanged(entityAndAttribute.getEntity(), entityAndAttribute.getAttribute(), val);
      }
focal_method.class_method_signature: AttributeMunger.setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)
focal_method.full_signature: public static void setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)
focal_method.identifier: setAttributeIfChanged
focal_method.invocations: setAttributeIfChanged getEntity getAttribute
focal_method.modifiers: public static
focal_method.parameters: (EntityAndAttribute<T> entityAndAttribute, T val)
focal_method.return: void
focal_method.signature: void setAttributeIfChanged(EntityAndAttribute<T> entityAndAttribute, T val)