package org.opentrafficsim.base;
import java.util.ArrayList;
import java.util.List;
/**
* Utility class for class operations.
*
* Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* @version $Revision$, $LastChangedDate$, by $Author$, initial version 2 jul. 2017
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public final class OTSClassUtil
{
/**
* Empty private constructor.
*/
private OTSClassUtil()
{
//
}
/**
* @param object T; the object to provide the class for
* @param the type
* @return the class of the object
*/
@SuppressWarnings("unchecked")
public static Class getTypedClass(final T object)
{
return (Class) object.getClass();
}
/**
* @param object T; the object to provide the class list for
* @param the type
* @return the class of the object
*/
@SuppressWarnings("unchecked")
public static Class> getTypedClassList(final T object)
{
List list = new ArrayList<>();
return (Class>) list.getClass();
}
}