Class AbstractMapValidatorBuilder<K,V,M extends Map<K,V>,PARENT,SELF extends AbstractMapValidatorBuilder<K,V,M,PARENT,SELF>>
java.lang.Object
io.github.mmm.validation.main.ObjectValidatorBuilder<V,PARENT,SELF>
io.github.mmm.validation.main.ContainerValidatorBuilder<M,PARENT,SELF>
io.github.mmm.validation.collection.AbstractMapValidatorBuilder<K,V,M,PARENT,SELF>
- Type Parameters:
K
- the generic type of thekeys
.V
- the generic type of thevalues
.M
- the generic type of the value tovalidate
.PARENT
- the generic type of theparent builder
.SELF
- the generic type of this builder itself (this).
- All Implemented Interfaces:
io.github.mmm.base.lang.Builder<Validator<? super M>>
,ValidatorRegistry<M,
SELF>
- Direct Known Subclasses:
ValidatorBuilderMap
public abstract class AbstractMapValidatorBuilder<K,V,M extends Map<K,V>,PARENT,SELF extends AbstractMapValidatorBuilder<K,V,M,PARENT,SELF>>
extends ContainerValidatorBuilder<M,PARENT,SELF>
- Since:
- 8.5.0
- Author:
- hohwille
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
max
(int max) size
(int min, int max) <SUB extends ObjectValidatorBuilder<K,
? extends SELF, ?>>
SUBwithKeys
(BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) Creates a newbuilder
for thevalidators
to invoke for eachkey
in theMap
.
UseObjectValidatorBuilder.and()
to return to this builder after the sub-builder is complete.
A typical usage looks like this:<SUB extends ObjectValidatorBuilder<V,
? extends SELF, ?>>
SUBwithValues
(BiFunction<ObjectValidatorBuilderFactory<SELF>, V, SUB> factory) Creates a newbuilder
for thevalidators
to invoke for eachvalues
in theMap
.
UseObjectValidatorBuilder.and()
to return to this builder after the sub-builder is complete.
A typical usage looks like this:Methods inherited from class io.github.mmm.validation.main.ContainerValidatorBuilder
getSubFactory
Methods inherited from class io.github.mmm.validation.main.ObjectValidatorBuilder
add, add, and, getValidators, mandatory, max, min, range, self
-
Constructor Details
-
AbstractMapValidatorBuilder
The constructor.- Parameters:
parent
- theparent
builder.
-
-
Method Details
-
size
-
size
-
max
- Parameters:
max
- the maximumsize
allowed.- Returns:
- this build instance for fluent API calls.
- See Also:
-
withKeys
public <SUB extends ObjectValidatorBuilder<K,? extends SELF, SUB withKeys?>> (BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) Creates a newbuilder
for thevalidators
to invoke for eachkey
in theMap
.
UseObjectValidatorBuilder.and()
to return to this builder after the sub-builder is complete.
A typical usage looks like this:[...].withKeys((f, v) -> f.create(v)).[...].and().[...].build()
- Type Parameters:
SUB
- the generic type of the returned sub-builder.- Parameters:
factory
- lambda function used to create the returned sub-builder by calling the accordingcreate
method on the suppliedObjectValidatorBuilderFactory
with the given dummy element.- Returns:
- the new sub-builder.
-
withValues
public <SUB extends ObjectValidatorBuilder<V,? extends SELF, SUB withValues?>> (BiFunction<ObjectValidatorBuilderFactory<SELF>, V, SUB> factory) Creates a newbuilder
for thevalidators
to invoke for eachvalues
in theMap
.
UseObjectValidatorBuilder.and()
to return to this builder after the sub-builder is complete.
A typical usage looks like this:[...].withValues((f, v) -> f.create(v)).[...].and().[...].build()
- Type Parameters:
SUB
- the generic type of the returned sub-builder.- Parameters:
factory
- lambda function used to create the returned sub-builder by calling the accordingcreate
method on the suppliedObjectValidatorBuilderFactory
with the given dummy element.- Returns:
- the new sub-builder.
-
build
-