#645 - Upgraded to Spring Plugin 2.0.
This commit is contained in:
@@ -47,7 +47,7 @@ public class LinkDiscoverers {
|
||||
* @return
|
||||
*/
|
||||
public LinkDiscoverer getLinkDiscovererFor(MediaType mediaType) {
|
||||
return discoverers.getPluginFor(mediaType);
|
||||
return discoverers.getRequiredPluginFor(mediaType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,13 +96,9 @@ public class DelegatingEntityLinks extends AbstractEntityLinks {
|
||||
*/
|
||||
private EntityLinks getPluginFor(Class<?> type) {
|
||||
|
||||
EntityLinks plugin = delegates.getPluginFor(type);
|
||||
|
||||
if (plugin == null) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Cannot determine link for %s! No EntityLinks instance found supporting the domain type!", type.getName()));
|
||||
}
|
||||
|
||||
return plugin;
|
||||
return delegates.getPluginFor(type) //
|
||||
.orElseThrow(() -> new IllegalArgumentException(
|
||||
String.format("Cannot determine link for %s! No EntityLinks instance found supporting the domain type!",
|
||||
type.getName())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DelegatingRelProvider implements RelProvider {
|
||||
*/
|
||||
@Override
|
||||
public String getItemResourceRelFor(Class<?> type) {
|
||||
return providers.getPluginFor(type).getItemResourceRelFor(type);
|
||||
return providers.getRequiredPluginFor(type).getItemResourceRelFor(type);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -47,7 +47,7 @@ public class DelegatingRelProvider implements RelProvider {
|
||||
*/
|
||||
@Override
|
||||
public String getCollectionResourceRelFor(java.lang.Class<?> type) {
|
||||
return providers.getPluginFor(type).getCollectionResourceRelFor(type);
|
||||
return providers.getRequiredPluginFor(type).getCollectionResourceRelFor(type);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,7 +48,7 @@ public class ControllerRelProvider implements RelProvider {
|
||||
*/
|
||||
@Override
|
||||
public String getCollectionResourceRelFor(Class<?> resource) {
|
||||
return providers.getPluginFor(entityType).getCollectionResourceRelFor(resource);
|
||||
return providers.getRequiredPluginFor(entityType).getCollectionResourceRelFor(resource);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -57,7 +57,7 @@ public class ControllerRelProvider implements RelProvider {
|
||||
*/
|
||||
@Override
|
||||
public String getItemResourceRelFor(Class<?> resource) {
|
||||
return providers.getPluginFor(entityType).getItemResourceRelFor(resource);
|
||||
return providers.getRequiredPluginFor(entityType).getItemResourceRelFor(resource);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user