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-2024 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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the value complies with constraints.static final <T> MultiConstraint<T>
create
(Constraint<? super T>... constraints) Creates aMultiConstraint
from 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 aMultiConstraint
from 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:
accept
in 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:
failMessage
in interfaceConstraint<T>
- Returns:
- Message for value failure, pointing to a parameter using '%s'.
-
toString
-