Java Code Examples for openmods.reflection.MethodAccess.Function0

The following examples show how to use openmods.reflection.MethodAccess.Function0. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: OpenModsLib   Source File: FunctionTypesTest.java    License: MIT License 5 votes vote down vote up
@Test
public void testFunction0() {
	abstract class F implements Function0<Integer> {}

	Assert.assertEquals(Integer.class, MethodAccess.resolveReturnType(F.class));
	Assert.assertArrayEquals(wrap(), MethodAccess.resolveParameterTypes(F.class));
}
 
Example 2
Source Project: OpenModsLib   Source File: FunctionTypesTest.java    License: MIT License 4 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testMultibaseFunction() {
	abstract class F implements Function0<Integer>, Function1<Integer, Boolean> {}
	MethodAccess.resolveParameterTypes(F.class);
}