Record Class JacksonProviderConfig
java.lang.Object
java.lang.Record
dev.resteasy.providers.jackson.JacksonProviderConfig
public record JacksonProviderConfig(Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> enabledFeatures, Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> disabledFeatures)
extends Record
Configuration for the
ResteasyJacksonProvider specifying which
JakartaRSFeatures to enable or disable. Register an implementation of
ContextResolver<JacksonProviderConfig> to supply configuration
to the provider.
Example:
@Provider
public class MyJacksonConfig implements ContextResolver<JacksonProviderConfig> {
@Override
public JacksonProviderConfig getContext(Class<?> type) {
return new JacksonProviderConfig(
Set.of(JakartaRSFeature.ADD_NO_SNIFF_HEADER),
Set.of(JakartaRSFeature.ALLOW_EMPTY_INPUT));
}
}
- Author:
- James R. Perkins
-
Constructor Summary
ConstructorsConstructorDescriptionJacksonProviderConfig(Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> enabledFeatures, Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> disabledFeatures) Creates a new configuration with defensive copies of the provided feature sets. -
Method Summary
Modifier and TypeMethodDescriptionSet<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> Returns the value of thedisabledFeaturesrecord component.Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> Returns the value of theenabledFeaturesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JacksonProviderConfig
public JacksonProviderConfig(Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> enabledFeatures, Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> disabledFeatures) Creates a new configuration with defensive copies of the provided feature sets.- Parameters:
enabledFeatures- the features to enable on the providerdisabledFeatures- the features to disable on the provider
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
enabledFeatures
Returns the value of theenabledFeaturesrecord component.- Returns:
- the value of the
enabledFeaturesrecord component
-
disabledFeatures
Returns the value of thedisabledFeaturesrecord component.- Returns:
- the value of the
disabledFeaturesrecord component
-