Java Code Examples for com.netflix.util.Pair#first()

The following examples show how to use com.netflix.util.Pair#first() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Server.java    From ribbon with Apache License 2.0 5 votes vote down vote up
static public String normalizeId(String id) {
    Pair<String, Integer> hostPort = getHostPort(id);
    if (hostPort == null) {
        return null;
    } else {
        return hostPort.first() + ":" + hostPort.second();
    }
}
 
Example 2
Source File: Server.java    From ribbon with Apache License 2.0 5 votes vote down vote up
public void setId(String id) {
    Pair<String, Integer> hostPort = getHostPort(id);
    if (hostPort != null) {
        this.id = hostPort.first() + ":" + hostPort.second();
        this.host = hostPort.first();
        this.port = hostPort.second();
        this.scheme = getScheme(id);
    } else {
        this.id = null;
    }
}