Skip to content

Commit 8ddf307

Browse files
author
innokenty
committed
add getAddress method to Host bean
1 parent a5b09db commit 8ddf307

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

config/src/main/java/ru/qatools/gridrouter/config/WithRoute.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@
1010
*/
1111
public interface WithRoute {
1212

13-
int getPort();
14-
15-
String getName();
16-
17-
int getCount();
13+
default String getAddress() {
14+
return getName() + ":" + getPort();
15+
}
1816

1917
default String getRoute() {
20-
return String.format("http://%s:%d", getName(), getPort());
18+
return "http://" + getAddress();
2119
}
2220

2321
default String getRouteId() {
2422
return DigestUtils.md5Hex(getRoute().getBytes(StandardCharsets.UTF_8));
2523
}
24+
25+
String getName();
26+
27+
int getPort();
2628
}

0 commit comments

Comments
 (0)