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

panda.lang.reflect.ConstructorCreator Maven / Gradle / Ivy

package panda.lang.reflect;

import java.lang.reflect.Constructor;

import panda.lang.Creator;
import panda.lang.Exceptions;

public class ConstructorCreator implements Creator {
	private Constructor constructor;

	/**
	 * @param constructor the constructor
	 */
	public ConstructorCreator(Constructor constructor) {
		this.constructor = constructor;
	}

	@Override
	public T create(Object... args) {
		try {
			return constructor.newInstance(args);
		}
		catch (Exception e) {
			throw Exceptions.wrapThrow(e);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy