A - the type of the array or collection to create a constraint forS - the type of this builder's sourceT - the type of elements processed by this builder's constraintspublic final class ComponentConstraintsBuilder<S,A,T> extends AbstractConstraintsBuilder<S,A,T>
Component constraints are satisfied only if all elements in the aggregate type satisfy the constraint.
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentConstraintsBuilder.ComponentConstraint<A,T>
A component constraints is satisfied only if all elements in the aggregate type it checks satisfy the constraint.
|
source, sourceConstraints, type| Modifier and Type | Method and Description |
|---|---|
static <S,T> ComponentConstraintsBuilder<S,T[],T> |
array(S source,
java.util.List<Constraint<? super T[]>> sourceConstraints,
java.lang.Class<T> type) |
ComponentConstraintsBuilder<S,A,T> |
atLeast(T min)
Implies that any value must be bigger than or equal to
min |
ComponentConstraintsBuilder<S,A,T> |
atMost(T max)
Implies that any value must be smaller than or equal to
max |
static <S,T,C extends java.util.Collection<T>> |
collection(S source,
java.util.List<Constraint<? super C>> sourceConstraints,
java.lang.Class<T> type) |
S |
finishComponent() |
ComponentConstraintsBuilder<S,A,T> |
maxLength(int max) |
ComponentConstraintsBuilder<S,A,T> |
minLength(int min) |
ComponentConstraintsBuilder<S,A,T> |
range(T min,
T max)
Convenience method to specify a range of valid values a number can take.
|
ComponentConstraintsBuilder<S,A,T> |
regex(java.lang.String regexPattern) |
public static <S,T> ComponentConstraintsBuilder<S,T[],T> array(S source, java.util.List<Constraint<? super T[]>> sourceConstraints, java.lang.Class<T> type)
public static <S,T,C extends java.util.Collection<T>> ComponentConstraintsBuilder<S,C,T> collection(S source, java.util.List<Constraint<? super C>> sourceConstraints, java.lang.Class<T> type)
public ComponentConstraintsBuilder<S,A,T> atLeast(T min) throws RuntimeFiberException
AbstractConstraintsBuilderminatLeast in class AbstractConstraintsBuilder<S,A,T>min - The minimum valueRuntimeFiberExceptionpublic ComponentConstraintsBuilder<S,A,T> atMost(T max)
AbstractConstraintsBuildermaxatMost in class AbstractConstraintsBuilder<S,A,T>max - The maximum valuepublic ComponentConstraintsBuilder<S,A,T> range(T min, T max)
AbstractConstraintsBuilder This method behaves as if: this.atLeast(min).atMost(max)
range in class AbstractConstraintsBuilder<S,A,T>min - The minimum valuemax - The maximum valuepublic ComponentConstraintsBuilder<S,A,T> minLength(int min)
minLength in class AbstractConstraintsBuilder<S,A,T>public ComponentConstraintsBuilder<S,A,T> maxLength(int max)
maxLength in class AbstractConstraintsBuilder<S,A,T>public ComponentConstraintsBuilder<S,A,T> regex(java.lang.String regexPattern)
regex in class AbstractConstraintsBuilder<S,A,T>public S finishComponent()