package usda.weru.util;

/**
 * This Class is Pandora's box for casting. All times in which a unsafe cast is
 * unavoidable, this class should be used.
 *
 * @author Nathan Lighthart
 */
public class Caster {

    /**
     * This method unifies all the unchecked cast to one place. This method is
     * no safer than doing the unchecked cast elsewhere. This method should only
     * be used as a last resort when there is no other way to remove the
     * unchecked cast warning. This method should stop being used if there is a
     * reasonable way around the cast.
     *
     * @param <T> Type to cast to
     * @param o Object to cast
     * @return The casted object
     */
	@SuppressWarnings("unchecked")
    public static <T> T cast(Object o) {
        return (T) o;
    }
}