T
- Type of object being decorated (e.g. JsonFactory
)E
- Feature enum type (e.g. JsonFactory.Feature
)public class FeatureDecorator<T,F extends Enum<F>> extends Object
Modifier | Constructor and Description |
---|---|
protected |
FeatureDecorator(Class<F> enumType,
BiFunction<T,F,T> enableFunction,
BiFunction<T,F,T> disableFunction) |
Modifier and Type | Method and Description |
---|---|
void |
addDisable(String feature)
Disables the feature with the given name.
|
void |
addEnable(String feature)
Enables the feature with the given name.
|
T |
decorate(T target) |
void |
disable(F feature)
Disables the given feature.
|
void |
enable(F feature)
Enables the given feature.
|
protected FeatureDecorator(Class<F> enumType, BiFunction<T,F,T> enableFunction, BiFunction<T,F,T> disableFunction)
public void addEnable(String feature)
feature
- the name of the feature to enablepublic void enable(F feature)
feature
- the feature to enablepublic void addDisable(String feature)
feature
- the name of the feature to disablepublic void disable(F feature)
feature
- the feature to disableCopyright © 2019. All rights reserved.