@Test public void updateMethodShouldHaveOverrideAnnotation() { MethodSpec method = entanglingClass.createUpdateMethod(); assertThat(method.annotations, hasItem(AnnotationSpec.builder(Override.class).build())); }
@VisibleForTesting MethodSpec createUpdateMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("update") .addModifiers(PUBLIC) .addAnnotation(Override.class) .addParameter(ClassName.get("java.util", "Observable"), "observable") .addParameter(Object.class, "data"); result.addStatement("target.$L.setVisibility((((quantum.Tangle<Boolean>) observable).getValue()) " + "? android.view.View.GONE : android.view.View.VISIBLE)", fieldName); return result.build(); }
EntanglingClass { @VisibleForTesting MethodSpec createUpdateMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("update") .addModifiers(PUBLIC) .addAnnotation(Override.class) .addParameter(ClassName.get("java.util", "Observable"), "observable") .addParameter(Object.class, "data"); result.addStatement("target.$L.setVisibility((((quantum.Tangle<Boolean>) observable).getValue()) " + "? android.view.View.GONE : android.view.View.VISIBLE)", fieldName); return result.build(); } }
EntanglingClass { @VisibleForTesting MethodSpec createUpdateMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("update") .addModifiers(PUBLIC) .addAnnotation(Override.class) .addParameter(ClassName.get("java.util", "Observable"), "observable") .addParameter(Object.class, "data"); result.addStatement("target.$L.setVisibility((((quantum.Tangle<Boolean>) observable).getValue()) " + "? android.view.View.GONE : android.view.View.VISIBLE)", fieldName); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId); }
EntanglingClass { @VisibleForTesting MethodSpec createUpdateMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("update") .addModifiers(PUBLIC) .addAnnotation(Override.class) .addParameter(ClassName.get("java.util", "Observable"), "observable") .addParameter(Object.class, "data"); result.addStatement("target.$L.setVisibility((((quantum.Tangle<Boolean>) observable).getValue()) " + "? android.view.View.GONE : android.view.View.VISIBLE)", fieldName); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);  }
EntanglingClass { @VisibleForTesting MethodSpec createUpdateMethod() { MethodSpec.Builder result = MethodSpec.methodBuilder("update") .addModifiers(PUBLIC) .addAnnotation(Override.class) .addParameter(ClassName.get("java.util", "Observable"), "observable") .addParameter(Object.class, "data"); result.addStatement("target.$L.setVisibility((((quantum.Tangle<Boolean>) observable).getValue()) " + "? android.view.View.GONE : android.view.View.VISIBLE)", fieldName); return result.build(); } EntanglingClass(String classPackage, String className, String targetClass, String fieldName, String connectionId);   }