|
15 | 15 | */ |
16 | 16 | package org.springframework.hateoas; |
17 | 17 |
|
18 | | -import java.util.Arrays; |
19 | 18 | import java.util.Set; |
20 | | -import java.util.stream.Collectors; |
21 | 19 |
|
22 | 20 | import org.springframework.util.Assert; |
23 | | -import org.springframework.util.ReflectionUtils; |
24 | 21 |
|
25 | 22 | /** |
26 | 23 | * Capture standard IANA-based link relations. |
@@ -1224,17 +1221,17 @@ public final class IanaLinkRelations { |
1224 | 1221 | /** |
1225 | 1222 | * Consolidated collection of {@link IanaLinkRelations}s. |
1226 | 1223 | */ |
1227 | | - private static final Set<LinkRelation> LINK_RELATIONS; |
1228 | | - |
1229 | | - static { |
1230 | | - |
1231 | | - LINK_RELATIONS = Arrays.stream(IanaLinkRelations.class.getDeclaredFields()) // |
1232 | | - .filter(ReflectionUtils::isPublicStaticFinal) // |
1233 | | - .filter(field -> LinkRelation.class.equals(field.getType())) // |
1234 | | - .map(it -> ReflectionUtils.getField(it, null)) // |
1235 | | - .map(LinkRelation.class::cast) // |
1236 | | - .collect(Collectors.toSet()); |
1237 | | - } |
| 1224 | + private static final Set<LinkRelation> LINK_RELATIONS = Set.of(ABOUT, ALTERNATE, APPENDIX, ARCHIVES, AUTHOR, |
| 1225 | + BLOCKED_BY, BOOKMARK, CANONICAL, CHAPTER, CITE_AS, COLLECTION, CONTENTS, CONVERTED_FROM, COPYRIGHT, CREATE_FORM, |
| 1226 | + CURRENT, DESCRIBED_BY, DESCRIBES, DISCLOSURE, DNS_PREFETCH, DUPLICATE, EDIT, EDIT_FORM, EDIT_MEDIA, ENCLOSURE, |
| 1227 | + FIRST, GLOSSARY, HELP, HOSTS, HUB, ICON, INDEX, INTERVAL_AFTER, INTERVAL_BEFORE, INTERVAL_CONTAINS, |
| 1228 | + INTERVAL_DISJOINT, INTERVAL_DURING, INTERVAL_EQUALS, INTERVAL_FINISHED_BY, INTERVAL_FINISHES, INTERVAL_IN, |
| 1229 | + INTERVAL_MEETS, INTERVAL_MET_BY, INTERVAL_OVERLAPPED_BY, INTERVAL_OVERLAPS, INTERVAL_STARTED_BY, INTERVAL_STARTS, |
| 1230 | + ITEM, LAST, LATEST_VERSION, LICENSE, LRDD, MEMENTO, MONITOR, MONITOR_GROUP, NEXT, NEXT_ARCHIVE, NOFOLLOW, |
| 1231 | + NOREFERRER, ORIGINAL, PAYMENT, PINGBACK, PRECONNECT, PREDECESSOR_VERSION, PREFETCH, PRELOAD, PRERENDER, PREV, |
| 1232 | + PREVIEW, PREVIOUS, PREV_ARCHIVE, PRIVACY_POLICY, PROFILE, RELATED, RESTCONF, REPLIES, SEARCH, SECTION, SELF, |
| 1233 | + SERVICE, START, STYLESHEET, SUBSECTION, SUCCESSOR_VERSION, TAG, TERMS_OF_SERVICE, TIMEGATE, TIMEMAP, TYPE, UP, |
| 1234 | + VERSION_HISTORY, VIA, WEBMENTION, WORKING_COPY, WORKING_COPY_OF); |
1238 | 1235 |
|
1239 | 1236 | private IanaLinkRelations() { |
1240 | 1237 | throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); |
|
0 commit comments