Package io.micronaut.http.codec
Interface MediaTypeCodecRegistry
-
- All Known Implementing Classes:
DefaultMediaTypeCodecRegistry
public interface MediaTypeCodecRegistry
A registry of decoders.
- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<MediaTypeCodec>
findCodec(MediaType mediaType)
Find a codec for the given media type.java.util.Optional<MediaTypeCodec>
findCodec(MediaType mediaType, java.lang.Class<?> type)
Find a codec for the given media type and target type.java.util.Collection<MediaTypeCodec>
getCodecs()
static MediaTypeCodecRegistry
of(MediaTypeCodec... codecs)
Create a new registry from the given codecs.static MediaTypeCodecRegistry
of(java.util.Collection<MediaTypeCodec> codecs)
Create a new registry from the given codecs.
-
-
-
Method Detail
-
findCodec
java.util.Optional<MediaTypeCodec> findCodec(@Nullable MediaType mediaType)
Find a codec for the given media type.- Parameters:
mediaType
- TheMediaType
- Returns:
- The codec
-
findCodec
java.util.Optional<MediaTypeCodec> findCodec(@Nullable MediaType mediaType, java.lang.Class<?> type)
Find a codec for the given media type and target type.- Parameters:
mediaType
- TheMediaType
type
- The type- Returns:
- The codec
-
getCodecs
java.util.Collection<MediaTypeCodec> getCodecs()
- Returns:
- The available codecs
-
of
static MediaTypeCodecRegistry of(MediaTypeCodec... codecs)
Create a new registry from the given codecs.- Parameters:
codecs
- The decoders- Returns:
- The registry
-
of
static MediaTypeCodecRegistry of(java.util.Collection<MediaTypeCodec> codecs)
Create a new registry from the given codecs.- Parameters:
codecs
- The decoders- Returns:
- The registry
-
-