public ApplicationLinkDetails build() { // be nice - rpcUrl & displayUrl are generally the same thing, so accept either if (rpcUrl == null) { rpcUrl = displayUrl; } else if (displayUrl == null) { displayUrl = rpcUrl; } if (rpcUrl == null) { throw new NullPointerException("either displayUrl or rpcUrl must be set before build()"); } cleanUriPaths(); return new ApplicationLinkDetails(checkNotNull(name, "name"), checkNotNull(displayUrl, "displayUrl"), checkNotNull(rpcUrl, "rpcUrl"), isPrimary); }