Restricting arguments to certain defined constants
<p>Consider the following code </p>

<pre><code>public class ColorScheme {

    public static final int     DARK_BLACK  = 0,
                                WHITE       = 1;

    private int Scheme;

    public ColorScheme() {
        this.Scheme     =   DARK_BLACK;
    }

    public ColorScheme(int SchemeType) {
        this.Scheme     =   SchemeType;
    }
}
</code></pre>

<p>I want the argument to the constructor  <code>ColorScheme(int SchemeType)</code> to be restricted to one of the <code>static final int</code> - <code>DARK_BLACK</code> or <code>WHITE</code> or other constant I may define.</p>

<p>For Ex: When someone instantiates the <code>ColorScheme</code> class, he can use  </p>

<pre><code> ColorScheme CS  = new ColorScheme(DARK_BLACK);
</code></pre>

<p>while   </p>

<pre><code> ColorScheme CS  = new ColorScheme(5); //or any other non-defined constant
</code></pre>

<p>should return an error.</p>
