Skip to content

Commit 3d03247

Browse files
committed
refactor(CountryUrl): extract exposeUrlsToView() method.
Addressed to #927 No functional changes.
1 parent 26113c0 commit 3d03247

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/main/java/ru/mystamps/web/Url.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,16 @@ public static Map<String, String> asMap(boolean production) {
120120
Map<String, String> map = new HashMap<>();
121121
AccountUrl.exposeUrlsToView(map);
122122
CategoryUrl.exposeUrlsToView(map);
123+
CountryUrl.exposeUrlsToView(map);
123124

124-
map.put("ADD_COUNTRY_PAGE", CountryUrl.ADD_COUNTRY_PAGE);
125125
map.put("ADD_IMAGE_SERIES_PAGE", ADD_IMAGE_SERIES_PAGE);
126126
map.put("ADD_PARTICIPANT_PAGE", ParticipantUrl.ADD_PARTICIPANT_PAGE);
127127
map.put("ADD_SERIES_ASK_PAGE", ADD_SERIES_ASK_PAGE);
128128
map.put("ADD_SERIES_PAGE", ADD_SERIES_PAGE);
129129
map.put("BOOTSTRAP_LANGUAGE", BOOTSTRAP_LANGUAGE);
130130
map.put("DAILY_STATISTICS", DAILY_STATISTICS);
131131
map.put("ESTIMATION_COLLECTION_PAGE", CollectionUrl.ESTIMATION_COLLECTION_PAGE);
132-
map.put("GET_COUNTRIES_PAGE", CountryUrl.GET_COUNTRIES_PAGE);
133132
map.put("INFO_COLLECTION_PAGE", CollectionUrl.INFO_COLLECTION_PAGE);
134-
map.put("INFO_COUNTRY_PAGE", CountryUrl.INFO_COUNTRY_PAGE);
135133
map.put("INFO_SERIES_PAGE", INFO_SERIES_PAGE);
136134
map.put("LIST_IMPORT_REQUESTS_PAGE", LIST_IMPORT_REQUESTS_PAGE);
137135
map.put("IMPORT_SERIES_SALES", IMPORT_SERIES_SALES);

src/main/java/ru/mystamps/web/feature/country/CountryUrl.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
package ru.mystamps.web.feature.country;
1919

20+
import java.util.Map;
21+
2022
/**
2123
* Country-related URLs.
2224
*
@@ -28,8 +30,8 @@
2830
public final class CountryUrl {
2931

3032
public static final String ADD_COUNTRY_PAGE = "/country/add";
31-
public static final String GET_COUNTRIES_PAGE = "/countries";
32-
public static final String INFO_COUNTRY_PAGE = "/country/{slug}";
33+
static final String GET_COUNTRIES_PAGE = "/countries";
34+
static final String INFO_COUNTRY_PAGE = "/country/{slug}";
3335

3436
// For backward compatibility
3537
static final String LIST_COUNTRIES_PAGE = "/country/list";
@@ -38,4 +40,10 @@ public final class CountryUrl {
3840
private CountryUrl() {
3941
}
4042

43+
public static void exposeUrlsToView(Map<String, String> urls) {
44+
urls.put("ADD_COUNTRY_PAGE", ADD_COUNTRY_PAGE);
45+
urls.put("GET_COUNTRIES_PAGE", GET_COUNTRIES_PAGE);
46+
urls.put("INFO_COUNTRY_PAGE", INFO_COUNTRY_PAGE);
47+
}
48+
4149
}

0 commit comments

Comments
 (0)