/** * Formats the full FijiURI up to the authority, preserving order. * * @param preserveOrdering Whether to preserve ordering. * @return Representation of this FijiURI up to the authority. */ private String toStringAuthority(boolean preserveOrdering) { StringBuilder sb = new StringBuilder(); sb.append(mScheme) .append("://"); appendClusterIdentifier(sb, preserveOrdering); return sb.toString(); }
/** {@inheritDoc} */ @Override protected StringBuilder appendClusterIdentifier( final StringBuilder sb, final boolean preserveOrdering ) { super.appendClusterIdentifier(sb, preserveOrdering); ImmutableList<String> contactPoints = preserveOrdering ? mContactPoints : mContactPointsNormalized; if (mUsername != null) { Preconditions.checkNotNull(mPassword); sb.append(mUsername); sb.append(":"); sb.append(mPassword); sb.append("@"); } if (contactPoints.size() == 1) { sb.append(contactPoints.get(0)); } else { sb.append('('); Joiner.on(',').appendTo(sb, contactPoints); sb.append(')'); } sb .append(':') .append(mContactPort) .append('/'); return sb; }