Currently there are only a few options to generate a short url:
getShortUrlSync()
getShortUrlSync(JSONObject params)
getShortUrlSync(String channel, JSONObject params)
getReferralUrlSync(Collection<String> tags, String channel, JSONObject params)
getContentUrlSync(String channel, JSONObject params)
getContentUrlSync(Collection<String> tags, String channel, JSONObject params)
getShortUrlSync(String channel, String feature, String stage, JSONObject params)
getShortUrlSync(String alias, String channel, String feature, String stage, JSONObject params)
getShortUrlSync(int type, String channel, String feature, String stage, JSONObject params)
getShortUrlSync(String channel, String feature, String stage, JSONObject params, int duration)
getShortUrlSync(Collection<String> tags, String channel, String feature, String stage, JSONObject params)
getShortUrlSync(String alias, Collection<String> tags, String channel, String feature, String stage, JSONObject params)
getShortUrlSync(int type, Collection<String> tags, String channel, String feature, String stage, JSONObject params)
getShortUrlSync(Collection<String> tags, String channel, String feature, String stage, JSONObject params, int duration)
And their a-sync equivalents:
getShortUrl(BranchLinkCreateListener callback)
getShortUrl(JSONObject params, BranchLinkCreateListener callback)
getReferralUrl(String channel, JSONObject params, BranchLinkCreateListener callback)
getReferralUrl(Collection<String> tags, String channel, JSONObject params, BranchLinkCreateListener callback)
getContentUrl(String channel, JSONObject params, BranchLinkCreateListener callback)
getContentUrl(Collection<String> tags, String channel, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(String alias, String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(int type, String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(String channel, String feature, String stage, JSONObject params, int duration, BranchLinkCreateListener callback)
getShortUrl(Collection<String> tags, String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(String alias, Collection<String> tags, String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(int type, Collection<String> tags, String channel, String feature, String stage, JSONObject params, BranchLinkCreateListener callback)
getShortUrl(Collection<String> tags, String channel, String feature, String stage, JSONObject params, int duration, BranchLinkCreateListener callback)
With just 28 options to create a link, I wouldn't worry too much about maintainability once you add a new optional parameter and the equivalent number of 2 - 36 new methods. /sarc
Instead, with eye on #83 and #76, consider replacing the above with a builder pattern:
String Builder#build
void Builder#buildAsync( BranchLinkCreateListener )
Builder Builder#setChannel( String channel )
Builder Builder#setAlias( String alias )
[...]
Builder Builder#setDuration( int duration )
Adding a new parameter will then add a whopping 1 new method. Not only that, you can defer asyncafication until building the url. Bonus: make it Parcelable and it can be passed around easily.
I think this would be a great addition.