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

testdata.OverloadedMethods Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package testdata;

import java.util.Collection;
import java.util.List;

/**
 * @author Sebastian Zarnekow - Initial contribution and API
 */
@SuppressWarnings("unused")
public class OverloadedMethods {

	public int usedConstructor = 0; 
	
	public OverloadedMethods() {
	}
	
	public OverloadedMethods(Collection collection, Iterable iterable) {
		usedConstructor = 1;
	}
	
	public OverloadedMethods(Iterable iterable, Collection collection) {
		usedConstructor = 2;
	}
	
	public OverloadedMethods(List list, List otherList) {
		usedConstructor = 3;
	}
	
	public OverloadedMethods(Iterable iterable, Iterable otherIterable) {
		usedConstructor = 4;
	}
	
	public String overloadedInt(int i) {
		return "overloadedInt(int)";
	}
	
	public String overloadedInt(Integer i) {
		return "overloadedInt(Integer)";
	}
	
	public  String overloaded(Collection collection, Iterable iterable) {
		return "overloaded(Collection,Iterable)";
	}
	
	public  String overloaded(Iterable iterable, Collection collection) {
		return "overloaded(Iterable,Collection)";
	}
	
	public  String overloaded(List list, List otherList) {
		return "overloaded(List,List)";
	}
	
	/**
	 * @since 2.4
	 */
	public  String overloaded(Object object, Object otherObject) {
		return "overloaded(Object,Object)";
	}
	
	public  String overloaded(Iterable iterable, Iterable otherIterable) {
		return "overloaded(Iterable,Iterable)";
	}
	
	public String overloaded2(Collection collection, Iterable iterable) {
		return "overloaded2(Collection,Iterable)";
	}
	
	public String overloaded2(Iterable iterable, Collection collection) {
		return "overloaded2(Iterable,Collection)";
	}
	
	public String overloaded2(List list, List otherList) {
		return "overloaded2(List,List)";
	}
	
	public String overloaded2(Iterable iterable, Iterable otherIterable) {
		return "overloaded2(Iterable,Iterable)";
	}
	
	public  String overloaded3(List list, List otherList) {
		return "overloaded(List,List)";
	}
	
	/**
	 * @since 2.3
	 */
	public static  int overloadedTypeParameters(String s) { return 1; }
	/**
	 * @since 2.3
	 */
	public static  long overloadedTypeParameters(Object o) { return 1L; }
	
	/**
	 * @since 2.3
	 */
	public static long overloadedVarArgs(Object o1, Object o2) { return 1L; }

	/**
	 * @since 2.3
	 */
	public static int overloadedVarArgs(String... s) { return s.length; }
	
	/**
	 * @since 2.4
	 */
	public static  String addAllOverloaded(Collection collection, Iterable elements) {
		return OverloadedMethods.addAllExtends(collection, elements);
	}
	
	/**
	 * @since 2.4
	 */
	public static  String addAllOverloaded(Iterable elements, Collection collection) {
		return addAllExtends(collection, elements);
	}
	
	/**
	 * @since 2.4
	 */
	public static  boolean addAllOverloaded(Collection collection, Collection elements) {
		return collection.addAll(elements);
	}
	
	/**
	 * @since 2.4
	 */
	public static  String addAllSuperExtends(Collection collection, Iterable elements) {
		return OverloadedMethods.addAllExtends(collection, elements);
	}
	
	/**
	 * @since 2.4
	 */
	public static  Collection addAllSuperExtends2(Collection collection, Iterable elements) {
		return null;
	}
	
	private static   String addAllExtends(Collection collection, Iterable elements) {
		return "addAll(Collection,Iterable)";
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy