Is there a 'clean' way to omit a static type declaration?
<p>So consider a function like this:</p>

<pre><code>public void setTemperature(double newTemperatureValue, TemperatureUnit unit)
</code></pre>

<p>where TemperatureUnit is defined as:</p>

<pre><code>public enum TemperatureUnit {celcius, kelvin, fahrenheit}
</code></pre>

<p>I would ideally like to get to is this:</p>

<pre><code>setTemperature(23, celcius);
</code></pre>

<p>So ultimately I would like to omit the 'TemperatureUnit.' part that would normally precede the value of the enum, since in this way the function reads more like as if it was regular text. </p>

<p>Now I can of course do a static import to accomplish this, but I wonder if there are alternatives to that, hopefully while also keeping things clean. I have heard of people using an interface that declares them, but which is also considered bad practice.</p>

<p>Any suggestions?</p>
