How to avoid many if/else conditions in the method?
<p>I'm in doubts am on right way for one of my methods. This one is a compositor of <code>URI</code> I'm using for my <code>http requests</code>. It just takes data from a separate static class with final <code>Strings</code>, merges them together and includes received from the server token where necessary. It happened all <code>URIs</code> are with token and the only one, authentication, without it. What I've done:</p>

<pre><code>private URI urlComposer(String apiUri, String token) { 
        URI uri = null;
        try {

            if(apiUri.equals("POST_AUTH_URL")) {
                uri = URIUtils.createURI(null, MyConfig.WEB_SERVER, -1, apiUri, null, null);
                return uri; 
            }

            String tmp = apiUri.toString();
            String[] array = tmp.split("&lt;token&gt;");
            tmp = array[0] + auth.getToken() + array[1];

            uri = URIUtils.createURI(null, MyConfig.WEB_SERVER, -1, tmp, null, null);

            if (MyConfig.DEBUG) Log.d("Dev", "Constructed url " + uri);
            return uri; 
        } catch (URISyntaxException e) {
            if (MyConfig.DEBUG) Log.d("Dev", "urlComposer was unable to construct a URL"); 
            e.printStackTrace();
        }
        return null;
    }
</code></pre>

<p>Trying to look in the future I don't like the idea to generate more if/else statements if I would have more special cases like this <code>POST_AUTH_URL</code>. One one hand I want the only one method to be called to construct a URI, on the other I don't want these <code>ifs</code>. What shall I do?</p>
