#806 - Polishing.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 the original author or authors.
|
* Copyright 2017-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 the original author or authors.
|
* Copyright 2017-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -24,7 +24,6 @@ import org.springframework.http.MediaType;
|
|||||||
import org.springframework.plugin.core.Plugin;
|
import org.springframework.plugin.core.Plugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Greg Turnquist
|
* @author Greg Turnquist
|
||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
*/
|
*/
|
||||||
@@ -32,7 +31,7 @@ public interface AffordanceModelFactory extends Plugin<MediaType> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare the {@link MediaType} this factory supports.
|
* Declare the {@link MediaType} this factory supports.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
default MediaType getMediaType() {
|
default MediaType getMediaType() {
|
||||||
@@ -41,7 +40,7 @@ public interface AffordanceModelFactory extends Plugin<MediaType> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Look up the {@link AffordanceModel} for this factory.
|
* Look up the {@link AffordanceModel} for this factory.
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* @param link
|
* @param link
|
||||||
* @param httpMethod
|
* @param httpMethod
|
||||||
@@ -50,7 +49,8 @@ public interface AffordanceModelFactory extends Plugin<MediaType> {
|
|||||||
* @param outputType
|
* @param outputType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AffordanceModel getAffordanceModel(String name, Link link, HttpMethod httpMethod, ResolvableType inputType, List<QueryParameter> queryMethodParameters, ResolvableType outputType);
|
AffordanceModel getAffordanceModel(String name, Link link, HttpMethod httpMethod, ResolvableType inputType,
|
||||||
|
List<QueryParameter> queryMethodParameters, ResolvableType outputType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if a plugin should be invoked according to the given delimiter.
|
* Returns if a plugin should be invoked according to the given delimiter.
|
||||||
@@ -60,9 +60,9 @@ public interface AffordanceModelFactory extends Plugin<MediaType> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default boolean supports(MediaType delimiter) {
|
default boolean supports(MediaType delimiter) {
|
||||||
|
|
||||||
return Optional.ofNullable(getMediaType())
|
return Optional.ofNullable(getMediaType()) //
|
||||||
.map(mediaType -> mediaType.equals(delimiter))
|
.map(mediaType -> mediaType.equals(delimiter)) //
|
||||||
.orElse(false);
|
.orElse(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user