Specific values as argument for function
<p>I've got a function which has 1 parameter/argument of type String:</p>

<pre><code>        public void foo(String myParam)
        {
           //do something
        }
</code></pre>

<p>the possible values of the string are restricted (eg.  "test","test2" and "test3"), any different value of myParam would cause an error.</p>

<p>Is it possible to restrict the possible values of myParam without a switch case which would check the value of myParam? </p>

<p>It would also be possible to pass a different object to my function which wraps the real value I need.</p>

<p>Is there a standard/best way solution for that?</p>
