package de.jreflect4;

import lombok.NonNull;
import lombok.SneakyThrows;

public class ClassReflector<T> extends BasicReflector<T> implements IClassReflector<T>{
	
	public ClassReflector(@NonNull final Class<T> reflectingClass) {
		this(reflectingClass, SecurityModelImpl.builder().build());
	}
	
	public ClassReflector(@NonNull final Class<T> reflectingClass, @NonNull final ISecurityModel securityModel) {
		super(reflectingClass, true, null, securityModel);
	}

	@Override
	@SneakyThrows
	public IInstanceReflector<T> create(final Object... args) {
		return new SimpleInstance<T>(invokeBestFittingConstructor(args), getSecurityModel());
	}
}
