Class MultiConstraint<T>
java.lang.Object
org.opentrafficsim.base.parameters.constraint.MultiConstraint<T>
- Type Parameters:
T- value type
- All Implemented Interfaces:
Constraint<T>
Constraint containing multiple constraints.
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the value complies with constraints.static final <T> MultiConstraint<T>create(Constraint<? super T>... constraints) Creates aMultiConstraintfrom given constraints.Returns a message for value failure, pointing to a parameter using '%s'.toString()
-
Constructor Details
-
MultiConstraint
Constructor.- Parameters:
constraints- Set<Constraint<? super T>>; constraints
-
-
Method Details
-
create
@SafeVarargs public static final <T> MultiConstraint<T> create(Constraint<? super T>... constraints) Creates aMultiConstraintfrom given constraints.- Type Parameters:
T- value type- Parameters:
constraints- Constraint<? super T>...; constraints- Returns:
MultiConstraint
-
accept
Checks whether the value complies with constraints.- Specified by:
acceptin interfaceConstraint<T>- Parameters:
value- T; Value to check.- Returns:
- Whether the value complies with constraints.
-
failMessage
Returns a message for value failure, pointing to a parameter using '%s'.- Specified by:
failMessagein interfaceConstraint<T>- Returns:
- Message for value failure, pointing to a parameter using '%s'.
-
toString
-