接口 Producible<E extends Enum<E> & Producible<E>>
- 类型参数:
E- enum type that implements this interface
- 所有已知实现类:
ApiVersion,PrometheusOutputFormat
public interface Producible<E extends Enum<E> & Producible<E>>
Interface that can be implemented by any
Enum that represents a finite set of
producible mime-types.
Can be used with @ReadOperation,
@WriteOperation and @DeleteOperation
annotations to quickly define a list of produces values.
Producible types can also be injected into operations when the underlying
technology supports content negotiation. For example, with web based endpoints, the
value of the Producible enum is resolved using the Accept header of the
request. When multiple values are equally acceptable, the value with the highest
ordinal is used.
- 从以下版本开始:
- 2.5.0
- 作者:
- Andy Wilkinson
-
方法概要
修饰符和类型方法说明Mime type that can be produced.default booleanReturn if this enum value should be used as the default value when an accept header of */* is provided, or if theAcceptheader is missing.
-
方法详细资料
-
getProducedMimeType
MimeType getProducedMimeType()Mime type that can be produced.- 返回:
- the producible mime type
-
isDefault
default boolean isDefault()Return if this enum value should be used as the default value when an accept header of */* is provided, or if theAcceptheader is missing. Only one value can be marked as default. If no value is marked, then the value with the highestordinalis used as the default.- 返回:
- if this value should be used as the default value
- 从以下版本开始:
- 2.5.6
-