public class CustomDecoder
extends java.lang.Object
Decoder implementation which allows extension through custom TypeConverter.Factory
instances. The custom factories are searched first, and if no appropriate converter is found, the default
converters used by DefaultDecoder will be consulted.| Modifier and Type | Method and Description |
|---|---|
static CustomDecoder |
create(java.util.Collection<? extends com.netflix.archaius.api.TypeConverter.Factory> customTypeConverterFactories)
Create a new
CustomDecoder with the supplied TypeConverter.Factory instances installed. |
<T> T |
decode(java.lang.Class<T> type,
java.lang.String encoded) |
<T> T |
decode(java.lang.reflect.Type type,
java.lang.String encoded) |
java.util.Optional<com.netflix.archaius.api.TypeConverter<?>> |
get(java.lang.reflect.Type type) |
public static CustomDecoder create(java.util.Collection<? extends com.netflix.archaius.api.TypeConverter.Factory> customTypeConverterFactories)
CustomDecoder with the supplied TypeConverter.Factory instances installed.
The default converter factories will still be registered, but will be installed AFTER any custom ones,
giving callers the opportunity to override the behavior of the default converters.customTypeConverterFactories - the collection of converter factories to use for this decoderpublic <T> T decode(java.lang.Class<T> type,
java.lang.String encoded)
decode in interface com.netflix.archaius.api.Decoderpublic <T> T decode(java.lang.reflect.Type type,
java.lang.String encoded)
decode in interface com.netflix.archaius.api.Decoderpublic java.util.Optional<com.netflix.archaius.api.TypeConverter<?>> get(java.lang.reflect.Type type)
get in interface com.netflix.archaius.api.TypeConverter.Registry