testdata.ClosureClient2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.eclipse.xtext.xbase.testing Show documentation
Show all versions of org.eclipse.xtext.xbase.testing Show documentation
Infrastructure for testing Xbase languages.
The newest version!
/*******************************************************************************
* Copyright (c) 2012, 2017 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package testdata;
import org.eclipse.xtext.xbase.lib.Functions;
/**
* @author Sebastian Zarnekow
* @since 2.3
*/
public class ClosureClient2 {
private String value;
@SafeVarargs
public ClosureClient2(Functions.Function0... functions) {
StringBuilder builder = new StringBuilder("varArgs:");
for(Functions.Function0 function: functions) {
builder.append(function.apply());
}
value = builder.toString();
}
public ClosureClient2(Functions.Function0 function1, Functions.Function0 function2) {
StringBuilder builder = new StringBuilder("twoArgs:");
builder.append(function1.apply());
builder.append(function2.apply());
value = builder.toString();
}
public String getValue() {
return value;
}
}