check the object passed is an instance of the specified data class