Add EndpointObjectMapper supported types method
Issue: 45876
This commit is contained in:
@@ -16,13 +16,15 @@
|
||||
|
||||
package org.springframework.boot.actuate.endpoint.jackson;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.springframework.boot.actuate.endpoint.OperationResponseBody;
|
||||
|
||||
/**
|
||||
* Interface used to supply the {@link ObjectMapper} that should be used when serializing
|
||||
* {@link OperationResponseBody} endpoint results.
|
||||
* endpoint results.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 3.0.0
|
||||
@@ -30,6 +32,11 @@ import org.springframework.boot.actuate.endpoint.OperationResponseBody;
|
||||
*/
|
||||
public interface EndpointObjectMapper {
|
||||
|
||||
/**
|
||||
* The default supported types.
|
||||
*/
|
||||
Set<Class<?>> DEFAULT_SUPPORTED_TYPES = Set.of(OperationResponseBody.class);
|
||||
|
||||
/**
|
||||
* Return the {@link ObjectMapper} that should be used to serialize
|
||||
* {@link OperationResponseBody} endpoint results.
|
||||
@@ -37,4 +44,13 @@ public interface EndpointObjectMapper {
|
||||
*/
|
||||
ObjectMapper get();
|
||||
|
||||
/**
|
||||
* Return the types that this endpoint mapper supports.
|
||||
* @return the supported types
|
||||
* @since 4.0.0
|
||||
*/
|
||||
default Set<Class<?>> getSupportedTypes() {
|
||||
return DEFAULT_SUPPORTED_TYPES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user