All Downloads are FREE. Search and download functionalities are using the official Maven repository.

testdata.ClosureClient2 Maven / Gradle / Ivy

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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy