Java, opinion on using Object class?
<p>I'm wondering what the general opinion is on using Java's Object class for something like this:</p>

<pre><code>private Car myCar;
private String myCarBrand;
public void set(String variableToSet, Object valueToSet){
    if(myCarBrand.equals("AUDI")){
        if(varibleToSet.equals("COLOR"))
            (Audi myCar).setColor((Color) valueToSet);
        ...
    }
    ...
}
</code></pre>

<p>Somehow I have the feeling that I shouldn't be using the Object class. However my reason for doing so is that not all cars have the same setter functions, now I could split this into multiple setters with the same name, but with different types of <code>valueToSet</code>, that however requires a lot more code, especially if my <code>valueToSet</code>'s have largely different types.</p>

<p>Thanks</p>

<p><strong>ERRATA</strong></p>

<ul>
<li><p><code>Audi extends Car</code></p></li>
<li><p>setColor is supposed to represent a class that is not applicable to all cars, something like <code>turnOnBackSeatDiscoLights</code> might have been better suited. </p></li>
</ul>
