openmods.reflection.MethodAccess.Function0 Java Examples

The following examples show how to use openmods.reflection.MethodAccess.Function0. 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 File: FunctionTypesTest.java    From OpenModsLib with 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 File: FunctionTypesTest.java    From OpenModsLib with 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);
}