}
if (builder == null && LettuceStrings.isNotEmpty(uri.getAuthority())) {
String[] hosts = uri.getAuthority().split("\\,");
for (String host : hosts) {
HostAndPort hostAndPort = HostAndPort.fromString(host);
if (builder == null) {
if (hostAndPort.hasPort()) {
builder = RedisURI.Builder.sentinel(hostAndPort.getHostText(), hostAndPort.getPort(), masterId);
} else {
builder = RedisURI.Builder.sentinel(hostAndPort.getHostText(), masterId);
}
} else {
if (hostAndPort.hasPort()) {
builder.withSentinel(hostAndPort.getHostText(), hostAndPort.getPort());
} else {
builder.withSentinel(hostAndPort.getHostText());
}
}
}
}