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

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature>
    Returns the value of the disabledFeatures record component.
    Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature>
    Returns the value of the enabledFeatures record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 provider
      disabledFeatures - the features to disable on the provider
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabledFeatures

      public Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> enabledFeatures()
      Returns the value of the enabledFeatures record component.
      Returns:
      the value of the enabledFeatures record component
    • disabledFeatures

      public Set<tools.jackson.jakarta.rs.cfg.JakartaRSFeature> disabledFeatures()
      Returns the value of the disabledFeatures record component.
      Returns:
      the value of the disabledFeatures record component