/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira.test
 */

package net.ranides.assira.test;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class TypeLoader1 implements Function<String, Supplier<Integer>> {

	@Override
	public Supplier<Integer> apply(String name) {
		try {
			Class<?> type = Class.forName(name);
			return (Supplier<Integer>)type.newInstance();
		} catch(ReflectiveOperationException cause) {
			throw new AssertionError("RE: "+name, cause);
		}
	}
	
}
