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 extends V> iterable) {
usedConstructor = 1;
}
public OverloadedMethods(Iterable extends V> iterable, Collection collection) {
usedConstructor = 2;
}
public OverloadedMethods(List list, List otherList) {
usedConstructor = 3;
}
public OverloadedMethods(Iterable extends V> iterable, Iterable extends V> 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 extends T> iterable) {
return "overloaded(Collection,Iterable)";
}
public String overloaded(Iterable extends T> 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 extends T> iterable, Iterable extends T> otherIterable) {
return "overloaded(Iterable,Iterable)";
}
public String overloaded2(Collection collection, Iterable extends V> iterable) {
return "overloaded2(Collection,Iterable)";
}
public String overloaded2(Iterable extends V> iterable, Collection collection) {
return "overloaded2(Iterable,Collection)";
}
public String overloaded2(List list, List otherList) {
return "overloaded2(List,List)";
}
public String overloaded2(Iterable extends V> iterable, Iterable extends V> 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 super K> collection, Iterable elements) {
return OverloadedMethods.addAllExtends(collection, elements);
}
/**
* @since 2.4
*/
public static String addAllOverloaded(Iterable elements, Collection super K> collection) {
return addAllExtends(collection, elements);
}
/**
* @since 2.4
*/
public static boolean addAllOverloaded(Collection super K> collection, Collection elements) {
return collection.addAll(elements);
}
/**
* @since 2.4
*/
public static String addAllSuperExtends(Collection super K> collection, Iterable extends K> elements) {
return OverloadedMethods.addAllExtends(collection, elements);
}
/**
* @since 2.4
*/
public static Collection addAllSuperExtends2(Collection super K> collection, Iterable extends K> elements) {
return null;
}
private static String addAllExtends(Collection collection, Iterable extends T> elements) {
return "addAll(Collection,Iterable)";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy