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

import java.lang.reflect.Type;
import java.util.List;

/**
 * 
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IClass extends IElement, Comparable<IClass> {
    
    /**
     * Collect information using java.reflection API
     * @param type
     * @return 
     */
    static IClass typeinfo(Type type) {
        return IContext.DEFAULT.typeinfo(type);
    }
    
    static IClass typefor(Object object) {
        return IContext.DEFAULT.typefor(object);
    }
    
    @Override
    IClasses collect();
    
    List<IClass> params();
    
    IFields fields();
    
    IMethods constructors();
    
    IMethods methods();
    
    /**
     * only parent class
     * @return 
     */
    @Override
    IClass parent();
    
    /**
     * 
     * @return only parent classes
     */
    IClasses parents();
    
    IClasses interfaces();
    
    IClass outer();
    
    IClasses inner();
    
    Class<?> raw();
    
    Type reflective();
    
    Object construct();
    
    Object construct(Object... arguments);
	
	/**
	 * Checks if {@code this} is superclass of {@code type} (or equals)
	 * @param type
	 * @return 
	 */
	boolean isSuper(IClass type);
	
	/**
	 * Checks if {@code this} is a subclass of {@code type} (or equals)
	 * @param type
	 * @return 
	 */
	boolean isSubclass(IClass type);
    
    boolean isPrimitive();
    
    boolean isInstance(Object value);

}
