use of org.eclipse.xtend.ide.codebuilder.AbstractMethodBuilder in project xtext-xtend by eclipse.
the class MethodBuilderTest method testJavaTypeParameter.
@Test
public void testJavaTypeParameter() {
AbstractMethodBuilder _createMethodBuilder = this._codeBuilderFactory.createMethodBuilder(this.getJavaClass());
final Procedure1<AbstractMethodBuilder> _function = (AbstractMethodBuilder it) -> {
it.setContext(this.getJavaClass());
it.setMethodName("foo");
JvmTypeParameter _createJvmTypeParameter = this._typesFactory.createJvmTypeParameter();
final Procedure1<JvmTypeParameter> _function_1 = (JvmTypeParameter it_1) -> {
it_1.setName("T");
};
JvmTypeParameter _doubleArrow = ObjectExtensions.<JvmTypeParameter>operator_doubleArrow(_createJvmTypeParameter, _function_1);
JvmTypeParameter _createJvmTypeParameter_1 = this._typesFactory.createJvmTypeParameter();
final Procedure1<JvmTypeParameter> _function_2 = (JvmTypeParameter it_1) -> {
it_1.setName("U");
};
JvmTypeParameter _doubleArrow_1 = ObjectExtensions.<JvmTypeParameter>operator_doubleArrow(_createJvmTypeParameter_1, _function_2);
it.setTypeParameters(Collections.<JvmTypeParameter>unmodifiableList(CollectionLiterals.<JvmTypeParameter>newArrayList(_doubleArrow, _doubleArrow_1)));
};
AbstractMethodBuilder _doubleArrow = ObjectExtensions.<AbstractMethodBuilder>operator_doubleArrow(_createMethodBuilder, _function);
StringConcatenation _builder = new StringConcatenation();
_builder.append("<T,U> void foo() {");
_builder.newLine();
_builder.append(" ");
_builder.append(AbstractBuilderTest.DEFAULT_BODY, " ");
_builder.append(";");
_builder.newLineIfNotEmpty();
_builder.append("}");
this.assertBuilds(_doubleArrow, _builder.toString());
}
Aggregations