public class ConfigurationImpl extends Object implements HibernateValidatorConfiguration, ConfigurationState
Configuration
implementation.ALLOW_MULTIPLE_CASCADED_VALIDATION_ON_RESULT, ALLOW_PARALLEL_METHODS_DEFINE_PARAMETER_CONSTRAINTS, ALLOW_PARAMETER_CONSTRAINT_OVERRIDE, CONSTRAINT_MAPPING_CONTRIBUTOR, CONSTRAINT_MAPPING_CONTRIBUTORS, ENABLE_TRAVERSABLE_RESOLVER_RESULT_CACHE, FAIL_FAST, SCRIPT_EVALUATOR_FACTORY_CLASSNAME, TEMPORAL_VALIDATION_TOLERANCE
Constructor and Description |
---|
ConfigurationImpl(BootstrapState state) |
ConfigurationImpl(ValidationProvider<?> provider) |
Modifier and Type | Method and Description |
---|---|
HibernateValidatorConfiguration |
addMapping(ConstraintMapping mapping)
Adds the specified
ConstraintMapping instance to the configuration. |
HibernateValidatorConfiguration |
addMapping(InputStream stream)
Add a stream describing constraint mapping in the Jakarta Bean Validation XML
format.
|
HibernateValidatorConfiguration |
addProperty(String name,
String value)
Adds a provider specific property.
|
HibernateValidatorConfiguration |
addValueExtractor(ValueExtractor<?> extractor)
Adds a value extractor.
|
HibernateValidatorConfiguration |
allowMultipleCascadedValidationOnReturnValues(boolean allow)
Define whether more than one constraint on a return value may be marked for cascading validation are allowed.
|
HibernateValidatorConfiguration |
allowOverridingMethodAlterParameterConstraint(boolean allow)
Define whether overriding methods that override constraints should throw a
ConstraintDefinitionException . |
HibernateValidatorConfiguration |
allowParallelMethodsDefineParameterConstraints(boolean allow)
Define whether parallel methods that define constraints should throw a
ConstraintDefinitionException . |
HibernateValidatorConfiguration |
beanMetaDataClassNormalizer(BeanMetaDataClassNormalizer beanMetaDataClassNormalizer)
Allows to set a
BeanMetaDataClassNormalizer that will be used to normalize the class before
accessing the metadata. |
ValidatorFactory |
buildValidatorFactory()
Build a
ValidatorFactory implementation. |
HibernateValidatorConfiguration |
clockProvider(ClockProvider clockProvider)
Defines the clock provider.
|
ConfigurationImpl |
constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)
Defines the constraint validator factory.
|
HibernateValidatorConfiguration |
constraintValidatorPayload(Object constraintValidatorPayload)
Allows to set a payload which will be passed to the constraint validators.
|
DefaultConstraintMapping |
createConstraintMapping()
Creates a new constraint mapping which can be used to programmatically configure the constraints for given types.
|
ConfigurationImpl |
enableTraversableResolverResultCache(boolean enabled)
Define whether the per validation call caching of
TraversableResolver results is enabled. |
HibernateValidatorConfiguration |
externalClassLoader(ClassLoader externalClassLoader)
Sets the class loader to be used for loading user-provided resources:
XML descriptors (
META-INF/validation.xml as well as XML constraint mappings)
classes specified by name in XML descriptors (e.g. |
HibernateValidatorConfiguration |
failFast(boolean failFast)
En- or disables the fail fast mode.
|
BeanMetaDataClassNormalizer |
getBeanMetaDataClassNormalizer() |
BootstrapConfiguration |
getBootstrapConfiguration()
Returns configuration information stored in the
META-INF/validation.xml file. |
ClockProvider |
getClockProvider()
Returns the clock provider for this configuration.
|
ConstraintValidatorFactory |
getConstraintValidatorFactory()
Returns the constraint validator factory of this configuration.
|
Object |
getConstraintValidatorPayload() |
ClockProvider |
getDefaultClockProvider()
Returns an implementation of the
ClockProvider
interface following the default ClockProvider
defined in the specification:
returns a clock representing the current system time and default time
zone.
|
ConstraintValidatorFactory |
getDefaultConstraintValidatorFactory()
Returns an implementation of the
ConstraintValidatorFactory interface
following the default ConstraintValidatorFactory defined in the
specification:
uses the public no-arg constructor of the ConstraintValidator
|
MessageInterpolator |
getDefaultMessageInterpolator()
Returns an implementation of the
MessageInterpolator interface
following the default MessageInterpolator defined in the
specification:
use the ValidationMessages resource bundle to load keys
use Locale.getDefault()
|
ParameterNameProvider |
getDefaultParameterNameProvider()
Returns an implementation of the
ParameterNameProvider
interface following the default ParameterNameProvider
defined in the specification:
returns the actual parameter names as provided in the validated
executable’s definition, if the class file of the executable contains
parameter name information
otherwise returns names in the form arg<PARAMETER_INDEX> ,
where PARAMETER_INDEX starts at 0 for the first parameter,
e.g. |
ResourceBundleLocator |
getDefaultResourceBundleLocator()
Returns the
ResourceBundleLocator used by the
default message
interpolator to load user-provided resource bundles. |
TraversableResolver |
getDefaultTraversableResolver()
Returns an implementation of the
TraversableResolver interface
following the default TraversableResolver defined in the
specification:
if Java Persistence is available in the runtime environment,
a property is considered reachable if Java Persistence considers
the property as loaded
if Java Persistence is not available in the runtime environment,
all properties are considered reachable
all properties are considered cascadable.
|
Set<ValueExtractor<?>> |
getDefaultValueExtractors()
Returns the default
ValueExtractor implementations as per the
specification. |
ClassLoader |
getExternalClassLoader() |
boolean |
getFailFast() |
Set<InputStream> |
getMappingStreams()
Returns a set of configuration streams.
|
MessageInterpolator |
getMessageInterpolator()
Returns the message interpolator of this configuration.
|
MethodValidationConfiguration |
getMethodValidationConfiguration() |
ParameterNameProvider |
getParameterNameProvider()
Returns the parameter name provider for this configuration.
|
Set<DefaultConstraintMapping> |
getProgrammaticMappings() |
Map<String,String> |
getProperties()
Returns a map of non type-safe custom properties.
|
ScriptEvaluatorFactory |
getScriptEvaluatorFactory() |
Duration |
getTemporalValidationTolerance() |
TraversableResolver |
getTraversableResolver()
Returns the traversable resolver for this configuration.
|
Set<ValueExtractor<?>> |
getValueExtractors()
Returns a set of value extractors.
|
HibernateValidatorConfiguration |
ignoreXmlConfiguration()
Ignores data from the
META-INF/validation.xml file if this
method is called. |
boolean |
isAllowMultipleCascadedValidationOnReturnValues() |
boolean |
isAllowOverridingMethodAlterParameterConstraint() |
boolean |
isAllowParallelMethodsDefineParameterConstraints() |
boolean |
isIgnoreXmlConfiguration()
Returns
true if Configuration.ignoreXmlConfiguration() has been
called. |
boolean |
isTraversableResolverResultCacheEnabled() |
ConfigurationImpl |
messageInterpolator(MessageInterpolator interpolator)
Defines the message interpolator used.
|
HibernateValidatorConfiguration |
parameterNameProvider(ParameterNameProvider parameterNameProvider)
Defines the parameter name provider.
|
HibernateValidatorConfiguration |
scriptEvaluatorFactory(ScriptEvaluatorFactory scriptEvaluatorFactory)
Allows to specify a custom
ScriptEvaluatorFactory responsible for creating ScriptEvaluator s
used to evaluate script expressions for ScriptAssert and ParameterScriptAssert constraints. |
HibernateValidatorConfiguration |
temporalValidationTolerance(Duration temporalValidationTolerance)
Allows to set the acceptable margin of error when comparing date/time in temporal constraints such as
Past /PastOrPresent and Future /FutureOrPresent . |
ConfigurationImpl |
traversableResolver(TraversableResolver resolver)
Defines the traversable resolver used.
|
public ConfigurationImpl(BootstrapState state)
public ConfigurationImpl(ValidationProvider<?> provider)
public final HibernateValidatorConfiguration ignoreXmlConfiguration()
Configuration
META-INF/validation.xml
file if this
method is called.
This method is typically useful for containers that parse
META-INF/validation.xml
themselves and pass the information
via the Configuration
methods.
ignoreXmlConfiguration
in interface Configuration<HibernateValidatorConfiguration>
this
following the chaining method pattern.public final ConfigurationImpl messageInterpolator(MessageInterpolator interpolator)
Configuration
If null
is passed, the default message interpolator is used
(defined in XML or the specification default).
messageInterpolator
in interface Configuration<HibernateValidatorConfiguration>
interpolator
- message interpolator implementationthis
following the chaining method patternpublic final ConfigurationImpl traversableResolver(TraversableResolver resolver)
Configuration
If null
is passed, the default traversable resolver is used
(defined in XML or the specification default).
traversableResolver
in interface Configuration<HibernateValidatorConfiguration>
resolver
- traversable resolver implementationthis
following the chaining method patternpublic final ConfigurationImpl enableTraversableResolverResultCache(boolean enabled)
HibernateValidatorConfiguration
TraversableResolver
results is enabled. The default
value is true
, i.e. the caching is enabled.
This behavior was initially introduced to cache the JPATraversableResolver
results but the map lookups it
introduces can be counterproductive when the TraversableResolver
calls are very fast.
enableTraversableResolverResultCache
in interface HibernateValidatorConfiguration
enabled
- flag determining whether per validation call caching is enabled for TraversableResolver
results.this
following the chaining method patternpublic final boolean isTraversableResolverResultCacheEnabled()
public final ConfigurationImpl constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory)
Configuration
If null
is passed, the default constraint validator factory is used
(defined in XML or the specification default).
constraintValidatorFactory
in interface Configuration<HibernateValidatorConfiguration>
constraintValidatorFactory
- constraint factory implementationthis
following the chaining method patternpublic HibernateValidatorConfiguration parameterNameProvider(ParameterNameProvider parameterNameProvider)
Configuration
If null
is passed, the default parameter name provider is used
(defined in XML or the specification default).
parameterNameProvider
in interface Configuration<HibernateValidatorConfiguration>
parameterNameProvider
- parameter name provider implementationthis
following the chaining method pattern.public HibernateValidatorConfiguration clockProvider(ClockProvider clockProvider)
Configuration
If null
is passed, the default clock provider is used
(defined in XML or the specification default).
clockProvider
in interface Configuration<HibernateValidatorConfiguration>
clockProvider
- clock provider implementationthis
following the chaining method pattern.public HibernateValidatorConfiguration addValueExtractor(ValueExtractor<?> extractor)
Configuration
addValueExtractor
in interface Configuration<HibernateValidatorConfiguration>
extractor
- value extractor implementationthis
following the chaining method pattern.public final HibernateValidatorConfiguration addMapping(InputStream stream)
Configuration
The stream should be closed by the client API after the
ValidatorFactory
has been built. The Jakarta Bean Validation provider
must not close the stream.
addMapping
in interface Configuration<HibernateValidatorConfiguration>
stream
- XML mapping stream; the given stream should support the
mark/reset contract (see InputStream.markSupported()
);
if it doesn't, it will be wrapped into a stream supporting the
mark/reset contract by the Jakarta Bean Validation providerthis
following the chaining method patternpublic final HibernateValidatorConfiguration failFast(boolean failFast)
HibernateValidatorConfiguration
failFast
in interface HibernateValidatorConfiguration
failFast
- true
to enable fail fast, false
otherwise.this
following the chaining method patternpublic HibernateValidatorConfiguration allowOverridingMethodAlterParameterConstraint(boolean allow)
HibernateValidatorConfiguration
ConstraintDefinitionException
.
The default value is false
, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"In sub types (be it sub classes/interfaces or interface implementations), no parameter constraints may be declared on overridden or implemented methods, nor may parameters be marked for cascaded validation. This would pose a strengthening of preconditions to be fulfilled by the caller."
allowOverridingMethodAlterParameterConstraint
in interface HibernateValidatorConfiguration
allow
- flag determining whether validation will allow overriding to alter parameter constraints.this
following the chaining method patternpublic boolean isAllowOverridingMethodAlterParameterConstraint()
public HibernateValidatorConfiguration allowMultipleCascadedValidationOnReturnValues(boolean allow)
HibernateValidatorConfiguration
false
, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"One must not mark a method return value for cascaded validation more than once in a line of a class hierarchy. In other words, overriding methods on sub types (be it sub classes/interfaces or interface implementations) cannot mark the return value for cascaded validation if the return value has already been marked on the overridden method of the super type or interface."
allowMultipleCascadedValidationOnReturnValues
in interface HibernateValidatorConfiguration
allow
- flag determining whether validation will allow multiple cascaded validation on return values.this
following the chaining method patternpublic boolean isAllowMultipleCascadedValidationOnReturnValues()
public HibernateValidatorConfiguration allowParallelMethodsDefineParameterConstraints(boolean allow)
HibernateValidatorConfiguration
ConstraintDefinitionException
. The
default value is false
, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"If a sub type overrides/implements a method originally defined in several parallel types of the hierarchy (e.g. two interfaces not extending each other, or a class and an interface not implemented by said class), no parameter constraints may be declared for that method at all nor parameters be marked for cascaded validation. This again is to avoid an unexpected strengthening of preconditions to be fulfilled by the caller."
allowParallelMethodsDefineParameterConstraints
in interface HibernateValidatorConfiguration
allow
- flag determining whether validation will allow parameter constraints in parallel hierarchiesthis
following the chaining method patternpublic HibernateValidatorConfiguration scriptEvaluatorFactory(ScriptEvaluatorFactory scriptEvaluatorFactory)
HibernateValidatorConfiguration
ScriptEvaluatorFactory
responsible for creating ScriptEvaluator
s
used to evaluate script expressions for ScriptAssert
and ParameterScriptAssert
constraints.scriptEvaluatorFactory
in interface HibernateValidatorConfiguration
scriptEvaluatorFactory
- the ScriptEvaluatorFactory
to be usedthis
following the chaining method patternpublic HibernateValidatorConfiguration temporalValidationTolerance(Duration temporalValidationTolerance)
HibernateValidatorConfiguration
Past
/PastOrPresent
and Future
/FutureOrPresent
.temporalValidationTolerance
in interface HibernateValidatorConfiguration
temporalValidationTolerance
- the acceptable tolerancethis
following the chaining method patternpublic HibernateValidatorConfiguration constraintValidatorPayload(Object constraintValidatorPayload)
HibernateValidatorConfiguration
constraintValidatorPayload
in interface HibernateValidatorConfiguration
constraintValidatorPayload
- the payload passed to constraint validatorsthis
following the chaining method patternpublic boolean isAllowParallelMethodsDefineParameterConstraints()
public MethodValidationConfiguration getMethodValidationConfiguration()
public final DefaultConstraintMapping createConstraintMapping()
HibernateValidatorConfiguration
HibernateValidatorConfiguration.addMapping(ConstraintMapping)
.createConstraintMapping
in interface HibernateValidatorConfiguration
public final HibernateValidatorConfiguration addMapping(ConstraintMapping mapping)
HibernateValidatorConfiguration
ConstraintMapping
instance to the configuration. Constraints configured in mapping
will be added to the constraints configured via annotations and/or xml.addMapping
in interface HibernateValidatorConfiguration
mapping
- ConstraintMapping
instance containing programmatic configured constraintsthis
following the chaining method patternpublic final HibernateValidatorConfiguration addProperty(String name, String value)
Configuration
Note: Using this non type-safe method is generally not recommended.
It is more appropriate to use, if available, the type-safe equivalent provided
by a specific provider via its Configuration
subclass.
ValidatorFactory factory = Validation.byProvider(ACMEProvider.class) .configure() .providerSpecificProperty(ACMEState.FAST) .buildValidatorFactory();This method is typically used by containers parsing
META-INF/validation.xml
themselves and injecting the state to the Configuration
object.
If a property with a given name is defined both via this method and in the XML configuration, the value set programmatically has priority.
If null
is passed as a value, the value defined in XML is used. If no value
is defined in XML, the property is considered unset.
addProperty
in interface Configuration<HibernateValidatorConfiguration>
name
- property namevalue
- property valuethis
following the chaining method patternpublic HibernateValidatorConfiguration externalClassLoader(ClassLoader externalClassLoader)
HibernateValidatorConfiguration
META-INF/validation.xml
as well as XML constraint mappings)ValidationMessages
resource bundleexternalClassLoader
in interface HibernateValidatorConfiguration
externalClassLoader
- The class loader for loading user-provided resources.this
following the chaining method patternpublic HibernateValidatorConfiguration beanMetaDataClassNormalizer(BeanMetaDataClassNormalizer beanMetaDataClassNormalizer)
HibernateValidatorConfiguration
BeanMetaDataClassNormalizer
that will be used to normalize the class before
accessing the metadata.beanMetaDataClassNormalizer
in interface HibernateValidatorConfiguration
beanMetaDataClassNormalizer
- the BeanMetaDataClassNormalizer
to usethis
following the chaining method patternpublic BeanMetaDataClassNormalizer getBeanMetaDataClassNormalizer()
public final ValidatorFactory buildValidatorFactory()
Configuration
ValidatorFactory
implementation.buildValidatorFactory
in interface Configuration<HibernateValidatorConfiguration>
ValidatorFactory
public final boolean isIgnoreXmlConfiguration()
ConfigurationState
true
if Configuration.ignoreXmlConfiguration()
has been
called.
In this case, the ValidatorFactory
must ignore
META-INF/validation.xml
.
isIgnoreXmlConfiguration
in interface ConfigurationState
true
if META-INF/validation.xml
should be ignoredpublic final MessageInterpolator getMessageInterpolator()
ConfigurationState
Message interpolator is defined in the following decreasing priority:
Configuration
programmatic APIMETA-INF/validation.xml
provided that
ignoreXmlConfiguration
is false. In this case the instance
is created via its no-arg constructor.null
if undefined.getMessageInterpolator
in interface ConfigurationState
null
if not definedpublic final Set<InputStream> getMappingStreams()
ConfigurationState
The streams are defined by:
Configuration
META-INF/validation.xml
(constraint-mapping element)
Streams represented in the XML configuration and opened by the
Configuration
implementation must be closed by the
Configuration
implementation after the ValidatorFactory
creation (or if an exception occurs). All streams are guaranteed to
adhere to the mark/reset contract (see InputStream.markSupported()
by the Jakarta Bean Validation provider.
getMappingStreams
in interface ConfigurationState
public final boolean getFailFast()
public final ConstraintValidatorFactory getConstraintValidatorFactory()
ConfigurationState
The ConstraintValidatorFactory
implementation is defined in the following
decreasing priority:
Configuration
programmatic APIMETA-INF/validation.xml
provided that
ignoredXmlConfiguration
is false
. In this case the instance
is created via its no-arg constructor.null
if undefined.getConstraintValidatorFactory
in interface ConfigurationState
null
if not definedpublic final TraversableResolver getTraversableResolver()
ConfigurationState
TraversableResolver
is defined in the following decreasing priority:
Configuration
programmatic APIMETA-INF/validation.xml
provided that
ignoredXmlConfiguration
is false
. In this case the
instance is created via its no-arg constructor.null
if undefined.getTraversableResolver
in interface ConfigurationState
null
if not definedpublic BootstrapConfiguration getBootstrapConfiguration()
Configuration
META-INF/validation.xml
file.
Note:
Implementations are encouraged to lazily build this object to delay parsing.
getBootstrapConfiguration
in interface Configuration<HibernateValidatorConfiguration>
BootstrapConfiguration
; this method never
returns null
; if there is no META-INF/validation.xml
the
different getters of the returned instance will return null
respectively an empty set or mappublic ParameterNameProvider getParameterNameProvider()
ConfigurationState
ParameterNameProvider
is defined in the following decreasing priority:
Configuration
programmatic APIMETA-INF/validation.xml
provided that
ignoreXmlConfiguration
is false
. In this case the instance
is created via its no-arg constructor.null
if undefined.getParameterNameProvider
in interface ConfigurationState
null
if not definedpublic ClockProvider getClockProvider()
ConfigurationState
ClockProvider
is defined in the following decreasing priority:
Configuration
programmatic APIMETA-INF/validation.xml
provided that
ignoreXmlConfiguration
is false
. In this case the instance
is created via its no-arg constructor.null
if undefined.getClockProvider
in interface ConfigurationState
null
if not definedpublic ScriptEvaluatorFactory getScriptEvaluatorFactory()
public Duration getTemporalValidationTolerance()
public Object getConstraintValidatorPayload()
public Set<ValueExtractor<?>> getValueExtractors()
ConfigurationState
The extractors are retrieved from the following sources in decreasing order:
Configuration
META-INF/validation.xml
provided
that ignoredXmlConfiguration
is false
META-INF/validation.xml
or loaded
through the service loader. Extractors defined in
META-INF/validation.xml
take precedence over any extractor for
the same type and type parameter loaded through the service loader.
Extractors defined in META-INF/validation.xml
or loaded through
the service loader are instantiated using their no-arg constructor.
getValueExtractors
in interface ConfigurationState
null
public final Map<String,String> getProperties()
ConfigurationState
Properties defined via:
Configuration.addProperty(String, String)
META-INF/validation.xml
provided that
ignoreXmlConfiguration
is false
.If a property is defined both programmatically and in XML, the value defined programmatically has priority.
getProperties
in interface ConfigurationState
Map
whose key is the property key and the value
the property valuepublic ClassLoader getExternalClassLoader()
public final MessageInterpolator getDefaultMessageInterpolator()
Configuration
MessageInterpolator
interface
following the default MessageInterpolator
defined in the
specification:
ValidationMessages
resource bundle to load keysLocale.getDefault()
getDefaultMessageInterpolator
in interface Configuration<HibernateValidatorConfiguration>
MessageInterpolator
implementation compliant with the
specificationpublic final TraversableResolver getDefaultTraversableResolver()
Configuration
TraversableResolver
interface
following the default TraversableResolver
defined in the
specification:
getDefaultTraversableResolver
in interface Configuration<HibernateValidatorConfiguration>
TraversableResolver
implementation compliant with the
specificationpublic final ConstraintValidatorFactory getDefaultConstraintValidatorFactory()
Configuration
ConstraintValidatorFactory
interface
following the default ConstraintValidatorFactory
defined in the
specification:
ConstraintValidator
getDefaultConstraintValidatorFactory
in interface Configuration<HibernateValidatorConfiguration>
ConstraintValidatorFactory
implementation compliant with the
specificationpublic final ResourceBundleLocator getDefaultResourceBundleLocator()
HibernateValidatorConfiguration
Returns the ResourceBundleLocator
used by the
default message
interpolator
to load user-provided resource bundles. In conformance with
the specification this default locator retrieves the bundle
"ValidationMessages".
This locator can be used as delegate for custom locators when setting a
customized ResourceBundleMessageInterpolator
:
HibernateValidatorConfiguration configure =
Validation.byProvider(HibernateValidator.class).configure();
ResourceBundleLocator defaultResourceBundleLocator =
configure.getDefaultBundleLocator();
ResourceBundleLocator myResourceBundleLocator =
new MyResourceBundleLocator(defaultResourceBundleLocator);
configure.messageInterpolator(
new ResourceBundleMessageInterpolator(myResourceBundleLocator));
getDefaultResourceBundleLocator
in interface HibernateValidatorConfiguration
ResourceBundleLocator
. Never null.public ParameterNameProvider getDefaultParameterNameProvider()
Configuration
ParameterNameProvider
interface following the default ParameterNameProvider
defined in the specification:
arg<PARAMETER_INDEX>
,
where PARAMETER_INDEX
starts at 0 for the first parameter,
e.g. arg0
, arg1
etc.getDefaultParameterNameProvider
in interface Configuration<HibernateValidatorConfiguration>
ParameterNameProvider
implementation compliant with
the specificationpublic ClockProvider getDefaultClockProvider()
Configuration
ClockProvider
interface following the default ClockProvider
defined in the specification:
getDefaultClockProvider
in interface Configuration<HibernateValidatorConfiguration>
ClockProvider
implementation compliant with
the specificationpublic Set<ValueExtractor<?>> getDefaultValueExtractors()
HibernateValidatorConfiguration
ValueExtractor
implementations as per the
specification.getDefaultValueExtractors
in interface HibernateValidatorConfiguration
ValueExtractor
implementations compliant
with the specificationpublic final Set<DefaultConstraintMapping> getProgrammaticMappings()
Copyright © 2021 JBoss by Red Hat. All rights reserved.