Package net.logstash.logback.decorate
Class FeatureDecorator<T,F extends Enum<F>>
java.lang.Object
net.logstash.logback.decorate.FeatureDecorator<T,F>
- Type Parameters:
T
- Type of object being decorated (e.g.JsonFactory
)F
- Feature enum type (e.g.JsonFactory.Feature
)
- Direct Known Subclasses:
CborFeatureJsonGeneratorDecorator
,FeatureJsonFactoryDecorator
,FeatureJsonGeneratorDecorator
,SmileFeatureJsonGeneratorDecorator
,YamlFeatureJsonGeneratorDecorator
A generic decorator that allows enabling/disabling of Jackson features.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FeatureDecorator
(Class<F> enumType, BiFunction<T, F, T> enableFunction, BiFunction<T, F, T> disableFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDisable
(String feature) Disables the feature with the given name.void
Enables the feature with the given name.void
Disables the given feature.void
Enables the given feature.
-
Constructor Details
-
FeatureDecorator
protected FeatureDecorator(Class<F> enumType, BiFunction<T, F, T> enableFunction, BiFunction<T, F, T> disableFunction)
-
-
Method Details
-
decorate
-
addEnable
Enables the feature with the given name. Reflectively called by logback when reading xml configuration.- Parameters:
feature
- the name of the feature to enable
-
enable
Enables the given feature. Use this method for programmatic configuration.- Parameters:
feature
- the feature to enable
-
addDisable
Disables the feature with the given name. Reflectively called by logback when reading xml configuration.- Parameters:
feature
- the name of the feature to disable
-
disable
Disables the given feature. Use this method for programmatic configuration.- Parameters:
feature
- the feature to disable
-