Skip to content

Commit ed008b6

Browse files
added NamedRoutes
1 parent 882064a commit ed008b6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package hexlet.code.util;
2+
3+
public final class NamedRoutes {
4+
5+
public static String rootPath() {
6+
return "/";
7+
}
8+
9+
public static String urlPath(Long id) {
10+
return urlPath(String.valueOf(id));
11+
}
12+
13+
public static String urlPath(String id) {
14+
return "/urls/" + id;
15+
}
16+
17+
public static String urlsPath() {
18+
return "/urls";
19+
}
20+
21+
public static String urlsPath(int page) {
22+
return "/urls?page=" + page;
23+
}
24+
25+
public static String urlCheckPath(Long id) {
26+
return urlCheckPath(String.valueOf(id));
27+
}
28+
29+
public static String urlCheckPath(String id) {
30+
return "/urls/" + id + "/checks";
31+
}
32+
33+
}
34+

0 commit comments

Comments
 (0)