#793 - Switch from @Order to Ordered.

This commit is contained in:
Greg Turnquist
2019-02-06 13:52:16 -06:00
parent ca72790b4b
commit a9bae74dcf
4 changed files with 43 additions and 17 deletions

View File

@@ -18,19 +18,24 @@ package org.springframework.hateoas.core;
import java.util.HashMap;
import java.util.Map;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.Order;
import org.springframework.hateoas.RelProvider;
/**
* @author Oliver Gierke
* @author Alexander Baetz
* @author Greg Turnquist
*/
@Order(100)
public class AnnotationRelProvider implements RelProvider {
public class AnnotationRelProvider implements RelProvider, Ordered {
private final Map<Class<?>, Relation> annotationCache = new HashMap<>();
@Override
public int getOrder() {
return 100;
}
/*
* (non-Javadoc)
* @see org.springframework.hateoas.RelProvider#getRelForCollectionResource(java.lang.Class)

View File

@@ -16,7 +16,6 @@
package org.springframework.hateoas.core;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.hateoas.RelProvider;
import org.springframework.util.StringUtils;
@@ -25,11 +24,16 @@ import org.springframework.util.StringUtils;
* single resource rel as well as an appended {@code List} for the collection resource rel.
*
* @author Oliver Gierke
* @author Greg Turnquist
*/
@Order(Ordered.LOWEST_PRECEDENCE)
public class DefaultRelProvider implements RelProvider {
public class DefaultRelProvider implements RelProvider, Ordered {
/*
@Override
public int getOrder() {
return Ordered.LOWEST_PRECEDENCE;
}
/*
* (non-Javadoc)
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
*/