T - object typepublic class SubCollectionConstraint<T> extends Object implements Constraint<Collection<T>>
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Field and Description |
|---|---|
protected Collection<T> |
objects
Acceptable objects.
|
| Constructor and Description |
|---|
SubCollectionConstraint(Collection<T> objects) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Collection<T> value)
Checks whether the value complies with constraints.
|
String |
failMessage()
Returns a message for value failure, pointing to a parameter using '%s'.
|
static <T> SubCollectionConstraint<T> |
newInstance(T... objs)
Creates a new instance with given collection.
|
String |
toString() |
protected final Collection<T> objects
public SubCollectionConstraint(Collection<T> objects)
objects - Collection<T>; acceptable objectspublic boolean accept(Collection<T> value)
accept in interface Constraint<Collection<T>>value - T; Value to check.public String failMessage()
failMessage in interface Constraint<Collection<T>>@SafeVarargs public static <T> SubCollectionConstraint<T> newInstance(T... objs)
T - typeobjs - T...; acceptable objectsCopyright © 2014–2019 Delft University of Technology. All rights reserved.